Worksheet 2.11 Unit Testing
Worksheet 2.11 Unit Testing
WORKSHEETS
Unit tests
Worksheet 2. 11.1
Vocabulary
Performed
isolate
mock
arrange
Bugs
trap
trace
to refactor
Worksheet 2. 11.2
UNIT TESTING is a type of software test where individual units or components of a software
are tested. The purpose is to validate that each unit of the software code works as
expected. Unit tests are performed during the development (coding phase) of an
application by developers. Unit tests isolate a section of code and verify its correctness. A unit
can be a function, method, procedure, module, or individual object. It is important to know
that unit tests rely on dummy objects to test sections of code that are not yet part of an entire
application. Dummy objects fill in the missing parts of the program.
Unit tests are important for many reasons. First, unit tests help correct bugs early in the
development cycle and save costs. Second, it helps developers understand the test code base
and allows them to make changes quickly. Finally, good unit tests serve as project
documentation. In general, if the right unit tests are done in early development, you end up
saving time and money.
3. Myth of unit tests
_________________________
Some developers say: It takes time, and I'm always busy. My code is rock solid! I don't need
unit tests.
Developers think that integration tests will detect all errors and will not run the unit test. Once
the drives are integrated, very simple errors take a long time to be tracked and corrected.
Therefore, the truth is that unit tests increase the speed of development.
There are many positives about unit testing. First, developers can examine unit tests to
gain a basic understanding of the unit API. Second, unit tests allow the developer to
refactor the code at a later date and ensure that the module continues to function
correctly. Finally, because of the modular nature of unit testing, we can test parts of the
project without waiting for others to complete.
However, there are also some negative aspects. Unit tests cannot detect all errors in a
program. It is not possible to evaluate all execution paths even in the most trivial
programs. In addition, unit tests, by their very nature, focus on a unit of code. As a result,
you cannot detect integration errors or broad system-level errors.
Worksheet 2. 11.4
Answer the following questions:
Worksheet 2. 11.5
Yes Maybe No
2. I understand what the Main Idea and Support Ideas strategy consists of.
Yes Maybe No
3. The Main Idea and Support Ideas strategy helps me understand the text better.
Yes Maybe No