Case Study 3 Toyota Spaghetti Logic - Okamoto

.docx

School

Pikes Peak Community College *

*We aren’t endorsed by this school

Course

1029N1

Subject

Mechanical Engineering

Date

Dec 6, 2023

Type

docx

Pages

3

Uploaded by cokamoto3

Report
Case Study – Toyota’s Spaghetti Logic Background On August 28, 2009 a California man was driving with three of his family members when the car accelerated to 100 mph, crashed and killed all four passengers. In September, Toyota announced that the fault was due to the floor mat getting stuck. More reports come in of unexpected acceleration. Toyota blames drivers for confusing the gas and brake pedals. The National Highway Safety Administration receives over 6,200 complaints of sudden acceleration in Toyota vehicles; including 89 deaths. A class action lawsuit (a lawsuit where the one of the parties is a group of people) brought in experts to examine what went wrong. What went wrong? Cars are built with embedded systems for functionality such as braking, ignition, security, audio, and GPS. 1. What are some critical systems in a car, besides the braking system, that could result in a loss of life if there’s a failure? Some critical systems in a car that could result in a loss of life if there is a failure include the ignition and steering and suspension. Cars are basically dangerous boxes on wheels.
When Toyota’s source code was examined it found, among other things, an excessive use of global variables. Upon closer examination, it was determined that most of these could have been local static variables. 2. Reading through the article "Toyota Unintended Acceleration and the Big Bowl of 'Spaghetti' Code" , how many global variables did Toyota use? Toyota used more than 10,000 global variables. 3. As a secure coding specialist, what is the danger of using global variables? Using global variables can make programs/codes less understandable and can cause bugs because they can cause things like shadowing, aliasing, implicit coupling, etc. The code was also described as being ‘spaghetti’ like. 4. What is meant by the term ‘spaghetti’ code, and why should it be avoided? The term “spaghetti code” refers to codes that are unorganized/unstructured and hard to understand/read. It should be avoided because it can cause cyber security risks and can make it hard to find and fix bugs. Some of the other issues with the code were: o Uninitialized variables o Concurrency issues o No mitigation in case of a stack overflow o Variables declared, but not used o A 16-byte array initialized with 17 bytes o Lack of comments throughout code
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help