Lesson Plan: Chapter 8

Connecting to CSTA Standards

GradesConceptSubconceptStandard NumberPractice
6-8Algorithms & ProgrammingProgram Development2-AP-17Testing and Refining Computational Artifacts: 6.1

Systematically test and refine programs using a range of test cases.

Use cases and test cases are created and analyzed to better meet the needs of users and to evaluate whether programs function as intended. At this level, testing should become a deliberate process that is more iterative, systematic, and proactive than at lower levels. Students should begin to test programs by considering potential errors, such as what will happen if a user enters invalid input (e.g., negative numbers and 0 instead of positive numbers).

Connecting to NGS Standards

GradesStandard NumberConceptPractice
6-8MS-ETS1-3Engineering DesignAnalyze data from tests to determine similarities and differences among several design solutions to identify the best characteristics of each that can be combined into a new solution to better meet the criteria for success

Learning Outcomes/Goals

In this chapter, students learn about the important mandate to test software to discover bugs, fix them, and improve the quality of the product. The storyline talks about how the various parts of the moss-protection strategy seem to have fit together into a full system that could probably be tested so as to ensure that it continues to function as expected and keep the moss safe.

Students discover the various types of testing, including unit tests, regression testing, integration testing, and a full system test. They are encouraged to look at a real software test that checks a form to check whether a field is filled in. This software can be found on GitHubopen in new window.


Differentiated Instruction

Lower level studentsHigher level students
Students should be able to construct a fully-documented testing planMore advanced students can write a real test using Playwright

Transfer Learning

Students can explore various aspects of software testingopen in new window in this YouTube channel.


Vocabulary

  • Integration test: Designed to test a larger group of components, such as an entire authentication strategy
  • Regression test: Designed to catch bugs that appear as software changes, ensuring the quality of the software remains high over its evolution
  • System test: Designed to test an entire system
  • Unit test: Designed to test a single component of an application such as a login form

Assessment

Students should be able to write an entire testing strategy around a test and design a test suite to expose its weak points.

FormativeSummative
Research how the various elements of a test suite are writtenWrite a summary of how the test suite designed in the lesson can be created and maintained

Quiz Answers

Which one of of these is a testing framework:

a. Playful

b. Playpretty

c. Playwright

TDD stands for:

a. Taco-driven development

b. Test-driven development

c. Training-driven development

A test can uncover faults in coding logic:

a. True

b. False


More Resources/Materials


Solution Code

The software to be tested and its test are found on GitHubopen in new window


Assignment and Rubric: Time to Test

Now that you have practiced designing a test suite for your Secure Moss prototype, create a five-part test suite outline for a system in real life. Find a web site that you can test. Think about the elements on the site that would benefit from having a solid test behind them. An example would be a login form on Fidelity.com, which has several fields and a button to log in. Even a simple form could have many tests to check for the integrity of the form. Use the attached worksheet on our web site to build out a suite for one element of a public-facing web site.

ExemplaryAdequateNeeds Improvement
The student creates a five part test suite with detailed instructions on the elements to test, and how to handle their various statesThe student creates a minimal test planThe student fails to show the minimal plan with its various states outlined

*tip: prior to saving as a PDF, select the 'light' mode at the top using the 'sun' icon.