98 379 Enu 2.2 LP

Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

MTA EXAM 98-379

Software Testing Fundamentals


98-379: OBJECTIVE 2
Describe Testing Methodology
LESSON 2.2
Describe Testing Levels
OVERVIEW Lesson 2.2

In this lesson, you will review the following:


• Unit testing
• Component and integration testing
GUIDING QUESTIONS Lesson 2.2

• What is it called when a developer tests an individual method?


• What is integration testing?
• What is another name for integration testing?
LECTURE Lesson 2.2

Unit testing
• Unit tests are automated tests that verify functionality at the
component, class, method, or property level.
• The primary goal of unit testing is to take the smallest piece of
testable software in the application, isolate it from the remainder of
the code, and determine whether it behaves exactly as you expect.
• Each unit is tested separately before integrating them into
components to test the interfaces between units.
• Unit tests should be written before (or very soon after) a method is
written. Often, developers building the class or method designs the
unit test themselves.
LECTURE Lesson 2.2

Unit testing example


• Consider a mobile app that accepts a person’s height and weight,
then calculates their Body Mass Index (BMI) and makes
recommendations for improving health and fitness. The BMI
calculation uses height in inches, but the user inputs feet plus inches
(e.g. 5’6”).
• Unit testing would include testing the method or function that
converts feet plus inches into total inches.
• The method that calculates BMI with weight and total inches could
be another unit test
» Note that unit tests cover code that is not necessarily visible to the
user—they probably don’t realize that height is getting converted.
LECTURE Lesson 2.2

Component and integration testing


• From a testing perspective, individual units are integrated together
to form larger components. In its simplest form, two units that have
already been tested are combined into an integrated component
and the interface between them is tested.
• This testing is called integration testing (or “component testing”).
• Integration testing identifies problems that occur when units are
combined. New errors that arise are likely related to the interface
between units rather than within the units themselves—this
simplifies the task for finding and correcting the defects.
LECTURE Lesson 2.2

Integration testing example


• In our BMI example, assume that we have written a method that
converts a person’s height into inches, and that we’ve written a
separate method that uses the appropriate formula to calculate BMI.
• When we write a third method that retrieves the user’s input, calls
the conversion method and uses the results to call the calculation
method, we need to test the integration between these pieces.
IN-CLASS ACTIVITY Lesson 2.2

Scenario:
Jay Henningsen is managing a team of developers working on an
application that will organize recreational basketball leagues and maintain
team and individual statistics as the season progresses. The team has
broken the algorithm down into pieces, with each member building a
method to solve one part of the problem. Using Microsoft® Visual Studio®
testing tools will be critical for the success of the team. Jay has decided to
ask each member to review the Test Explorer.
Directions:
Create a new project in Visual Studio 2012. Name the project Lesson 2.2-IC.
• Complete the Quick start: Test driven development with Test Explorer
http://msdn.microsoft.com/en-us/library/hh212233.aspx
IN-CLASS ACTIVITY Lesson 2.2

Follow up:
After completing the walkthrough activity, share your experiences with
a partner.

• What difficulties did you experience?


• How did you resolve them?
• Identify three things you learned from this activity.
REVIEW Lesson 2.2

Can you answer these?


• What is it called when a developer tests an individual method?
• What is integration testing?
• What is another name for integration testing?
ADDITIONAL RESOURCES Lesson 2.2

MSDN® Resources
Unit Testing http://msdn.microsoft.com/en-
us/library/aa292197.aspx
Unit Testing: Testing the Inside http://msdn.microsoft.com/en-
us/library/jj159340.aspx
Integration Testing http://msdn.microsoft.com/en-
us/library/aa292128.aspx
Unit testing, component level http://blogs.msdn.com/b/raulperez/archive
testing and UI testing, what to /2010/04/29/unit-testing-component-
use and when level-testing-and-ui-testing-what-to-use-
and-when.aspx

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy