Please enable JavaScript to use CodeHS

Testing 1, 2, 3 ...

In this project, students are going to prompt the user for a DNA string. After reading that string in, you will pass this string to a function to simulate testing for a parasite.

Easy

1 Hour

High School

Project Description

Overview

In this project, students are going to prompt the user for a DNA string. After reading that string in, you will pass this string to a function to simulate testing for a parasite.


In this practice PT, we are going to focus on the testing aspect of the performance task. You will need to create a procedure that takes an input parameter and executes a different part of the code based on that parameter. This means you must use a selection (if/else) statement in your function.

Unit Testing

Part of the development process is testing your code. While we will not get too deep into the testing process as part of this module, it is important to understand the idea of unit testing for a procedure or function.

When we use top-down design concepts, our program gets split into small pieces, often in the form of individual functions. Unit testing is the process of testing each of these functions by varying the input and verifying that the output is as expected.


Testing in the Create Task

The fourth prompt on the Create Performance Task requires you to describes two calls to a procedure identified in the written response. Each call must pass a different argument(s) that causes a different segment of code to execute.

You then need to describe what your call is, what condition is being tested, and what the output is.


Project Demo

Explore this program before assigning it!