Code without tests is broken by design. ~ Jacob Kaplan-Moss

Learning Objectives

  • Formulate test cases from requirements
  • Calculate cyclomatic complexity and create test cases for each basis path
  • Use static analysis tools to identify faults in programs
  • Decide if an issue reported by a static analysis tool is a false positive

How to Complete this Lesson

Complete the following learning activities: (1.25–1.5 hours total)

  1. Watch the following videos:
  2. Attend the class meeting (60 minutes)
  3. Complete the course evaluation if you have not done so already (5–10 minutes)

Due

As a reminder, the following is due this lesson:

Resources

Videos

Further Reading

Hovemeyer and Pugh, “Finding Bugs is Easy,” Proceedings of the 19th ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA '04), pp. 132–136, October 2004 (slides)

Ayewah et al., “Using Static Analysis to Find Bugs,” IEEE Software, Vol. 25, No. 5, pp. 22–29, September / October 2008

Bessey, Block, Chelf, Chou, Fulton, Hallem, Henri-Gros, Kamsky, McPeak, and Engler, “A Few Billion Lines of Code Later: Using Static Analysis to Find Bugs in the Real World,” Communications of the ACM, Vol. 53, No. 2, pp. 66–75, February 2010 (online)

Sadowski, Aftandilian, Eagle, Miller-Cushon, and Jaspan, “Lessons from Building Static Analysis Tools at Google,” Communications of the ACM, Vol. 61, No. 4, pp. 58–66, April 2018 (online)

Distefano, Fähndrich, Logozzo, and O’Hearn, “Scaling Static Analyses at Facebook,” Communications of the ACM, Vol. 62, No. 8, pp. 62–70, August 2019 (online)

Static Analysis

SpotBugs (Java)

Infer (Java or C / C++ / Objective-C)

Flake8 (Python)