You are on page 1of 10

UNIT TESTING

Unit Testing
Worksheet 2.1

Check out the list of words and tell your teacher and classmates how many
of them you already know. Share their meanings with the class and write
down the meanings of the ones you don’t know.

Vocabulary

 Performs

 Isolate

 Mock

 Fix

 Bugs

 Catch

 Trace

 To refactor
Worksheet 2.2
Use the new vocabulary in order to complete the crossword. Make sure you
read carefully all the words.

 ____________: It is a method/object that simulates the behavior of a real


method/object in controlled ways.
 ____________: To find or look for something.
 ____________: It is the process of restructuring existing computer code.
 ____________: Those are errors or problems in a program.
 ____________: To separate something from other things with which it is
connected or mixed.
 ____________: The new program ... very well on my computer.
 ____________: To notice something that is partly hidden or not clear, or to
discover something, especially using a method.
 ____________: Remove errors from a computer program.
Worksheet 2.3
Watch the video called “Paragraph” and complete the next activities.

 Match the sentence halves together.

1. A topic sentence expresses the main a. the main idea expressed in the
idea topic sentence is true or valid.

b. help develop supporting ideas.


2. Supporting sentences help show that

3. Details can include examples or c. in different words and may also


explanations to summarize the supporting ideas.
4. A concluding sentence restates the d. of the paragraph and all sentences
main idea in the paragraph support it.

Read the paragraph below and answer the questions.

1. Dogs make better companions than cats. 2. The main reason why many people prefer
dogs to cats is their loyalty. 3. They show this by being obedient and showing affection
to their masters. 4. Cats, on the other hand, cannot be trained and treat their owners
with indifference.
5. Secondly, dogs are more fun to spend time with. You can take your dog running,
swimming at the beach or even play frisbee. 7. Conversely, cats like to do their own thing
and are not inclined to join in play such as chasing a ball. 8. Finally, dogs help make your
home more secure. 9. If an unknown person tries to enter your home or property, a dog
will alert you with their bark or even attack the intruder. 10. A cat, on the other hand,
will stay silent and let anyone enter your home. 11. To sum up, dogs are the best choice
as a pet because they are loyal, fun and provide security.

a. Which sentence expresses the main idea of the paragraph? .........

b. Which sentences give reasons to support the main idea? .........

c. Which sentences explain or give examples of the first reason? .........


d. Which sentence repeats the main idea and summarizes the supporting ideas? .........

Worksheet 2.3
In the text below you will see that there are gaps for all the subtitles. Read
each section and choose the best subtitle from the list below. This activity
will help you to identify the key idea of each section.

A. Why Unit Testing? 1-C. 2-A. 3-E. 4-B. 5-D.


B. Unit Testing Advantage
C. What is Unit Testing?
D. Unit Testing Disadvantages
E. Unit Testing Myth

Unit Testing Basics


1. ________________________
UNIT TESTING is a type of software testing where individual units or
components of a software are tested. The purpose is to validate that each
unit of the software code performs as expected. Unit Testing is done during
the development (coding phase) of an application by the developers. Unit
Tests isolate a section of code and verify its correctness. A unit may be an
individual function, method, procedure, module, or object. It is important to
know that unit testing relies on mock objects to test sections of code that are
not yet part of a complete application. Mock objects fill in for the missing
parts of the program.
2. ________________________
Unit Testing is important because of many reasons. First, unit tests help to fix
bugs early in the development cycle and save costs. Second, it helps the
developers to understand the testing code base and allows them to make
changes quickly. Finally, good unit tests serve as project documentation. In
general, if proper unit testing is done in early development, then it saves
time and money in the end.

3. _________________________
Some developer say: It requires time, and I am always busy. My code is rock
solid! I do not need unit tests.

Programmers think that Integration Testing will catch all errors and do not
execute the unit test. Once units are integrated, very simple errors take a
very long time to be traced and fixed. Therefore, the truth is Unit testing
increments the speed of development.
4. _________________________
There are many positive aspects about Unit testing. First, developers can look
at the unit tests to gain a basic understanding of the unit API. Second, unit
testing allows the programmer to refactor code at a later date, and make
sure the module still works correctly. Finally, due to the modular nature of
the unit testing, we can test parts of the project without waiting for others to
be completed.

5. _________________________
However, there are also some negative aspects. Unit testing can't catch every
error in a program. It is not possible to evaluate all execution paths even in
the most trivial programs. Also, unit testing by its very nature focuses on a
unit of code. As a result, it can't catch integration errors or broad system
level errors.
Worksheet 2.4
WRAP-UP
After reading the text “Unit Testing Basics”, answer the following
questions.

1. What can be “a unit”?

2. How can unit tests help programmers?

3. Why do some developers never do unit testing?

4. What limitations does unit testing have?


Worksheet 2.5

Fill out the following self-evaluation section.

1. Entiendo qué es Unit Testing.

Yes 😃 Maybe 😐 No 😟

2. Entiendo en qué consiste la estrategia Identify Key Ideas.

Yes 😃 Maybe 😐 No 😟

3. La estrategia Identify Key Ideas me ayuda a entender el texto


mejor.
Yes 😃 Maybe 😐 No 😟

You might also like