JUnit 5 Quick Start: Java Unit Testing

How to write and run Java Unit tests using JUnit 5

JUnit asserts and annotations

Test-driven development

How to use JUnit for bug fixes

How to use JUnit for feature requests

The import statements needed to run JUnit

Best practices and coding conventions

How to understand test output

Requirements

  • Basic experience with Java (creating classes, understanding methods, etc.)
  • Beginner to JUnit

Description

Let’s make things easy! In this quick-start course, students will learn how to write and run JUnit Java unit tests. Imports, annotations, and test output will illustrated and explained.  Best practices are discussed and demonstrated through examples and applications. By the end of the course, students will be able to conduct their own JUnit tests, successfully interpret test output, and incorporate best practices in their software development. The course is taught by a straight-A Ivy League graduate with industry experience in the subject matter.  No prior knowledge of JUnit is required. 

Who this course is for:

  • Java developers (beginner or advanced) who want to learn JUnit

Course content

3 sections • 11 lectures • 34m total lengthExpand all sections

Introduction2 lectures • 4min

  • Introduction: what JUnit is, how it works, and why it is important.04:01
  • Course requirements00:26

JUnit fundamentals8 lectures • 29min

  • Your first JUnit tests: @Test, assertEquals(), assertNotEquals()03:50
  • The assertTrue() and assertFalse() methods.03:32
  • Practice: JUnit methods04:15
  • Fielding a bug report : best-practices demonstration03:25
  • Implementing a feature request : best-practices demonstration04:45
  • @BeforeAll, @AfterAll annotations02:31
  • The assertArrayEquals() method04:15
  • Development practice: performing a bugfix02:40
  • Quiz 15 questions
  • Quiz 24 questions

Course wrap-up1 lecture • 1min

  • Course conclusion00:39

Using UFT Developer for Web Apps (Basic Course)

UI Testautomation with UFT Developer

Building Basic Test Scripts

Working with Object Identification Center

Working with Application Models

Using Reporter Object

Define Custom Checkpoints

Screen Recording

Parametrization

Data Driven Testing

Reusable Functions

Requirements

  • IntelliJ Installation
  • Java Basic Understanding
  • JUnit Installation

Description

UFT Developer helps you develop automated tests for a wide range of technologies, using standard IDEs with modern programming languages. UFT Developer requires familiarity with the basics of programming in the language you use to develop your tests.

Requirements prior course:

  • Install the UFT Developer runtime engine on any machine where you want to run UFT Developer tests.
  • Install one or more supported IDEs and the relevant UFT Developer plugins on any machine where you want to write and edit UFT Developer tests.

In this course, you will learn how to use UFT Developer for Java using IntelliJ and JUnit as testing framework.

In the IDE of your choice, create a UFT Developer testing project, use UFT Developer to create test object descriptions and write tests that can perform operations on your applications.

Create a testing project

Create a UFT Developer testing project in the IDE of your choice, using the project templates provided with the UFT Developer plugins or use your own custom framework.

Customize your test settings

Customize the UFT Developer runtime server settings and report options.

Define test objects

Create test object descriptions that enable UFT Developer to identify the objects in your application and can withstand changes in the application you’re testing.

Write programmatic descriptions or use the visually oriented tools that UFT Developer offers to provide an interface to the tested application and its objects.

Write tests

After you create test object descriptions, write automated tests whose steps call the methods and properties of these UFT Developer test objects.

Add code to verify application behavior

Verify that the objects in your application look and behave as you expect.

When these special steps return false results, the step and test fail, but no exception is thrown and your test continues to run.

This course will cover the following:

  • Build Application Models
  • Create Test Scripts
  • Running Test Scripts
  • Calculation and custom checkpoints
  • Output Values and Parametrization
  • Data Driven Testing
  • Screen Recorder 
  • Using Reporter Object
  • Working with Test Recorder
  • Summary

Upon successful completion of this course, you will be eligible to:

  • be more productive
  • better collaborate
  • use agile methodologies in a smarter way
  • support the software delivery lifecycle
  • take on lead roles in your projects and advance in your career

Who this course is for:

  • Developer
  • Tester
  • Automation Engineer
  • DevTester
  • SDET

Course content

1 section • 11 lectures • 1h 47m total length

UFT Developer for Web Applications11 lectures • 1hr 48min

  • Introduction to UFT Developer Automation for Web Applications (Basic Course)02:46
  • Build Application Models for Web App20:11
  • Build Basic Test for Web App20:44
  • Calculation, output and custom checkpoints21:12
  • Parametrization and Data Driven Testing05:01
  • Working with Native Object Properties07:36
  • Working with the Reporter Object09:32
  • Using the Test Recorder04:28
  • RunJavaScript on BrowserPage04:06
  • Utilizing ScreenCapture03:17
  • Additional Settings & Summary08:42

Apache Maven Tutorial : Manage Java Dependencies Like a Pro

We will create a maven project in Java using Maven Archetypes

Compiling Maven Projects from command line

Working on Maven project from eclipse

Understanding POM and maven terminologies

Industry Best Practices

Running tests from maven on command line

Requirements

  • Internet Connection to download maven dependencies
  • Very Basic knowledge of testng or junit and selenium

Description

Maven is the most popular Java Dependency Management Tool.

This course will enable you to build a maven project from scratch and configure all the dependencies required for a project

We will discuss how to run various test from  command line in maven

We will discuss how to trigger testng xmls using maven

We will be talking about various terminologies used in maven project

Who this course is for:

  • Automation Testers who want to develop automation frameworks and learn maven
  • Beginners who wants to learn build tools like Apache Maven

Course content

1 section • 6 lectures • 50m total length

Introduction6 lectures • 51min

  • Introduction to maven and why we need it ?06:40
  • Apache Maven Set Up and First Maven Project in Java11:41
  • Understanding POM.xml and downloading project dependencies12:53
  • Compiling and Running tests from command line using surefire plugin07:07
  • Triggering testng.xml from maven05:06
  • Selective Suite selection using profiling in maven07:16

Using UFT Developer for WPF Desktop Apps (Basic Course)

UI Testautomation with UFT Developer

Building Basic Test Scripts

Working with Object Identification Center

Working with Application Models

Using Reporter Object

Define Custom Checkpoints

Use Visual Relation Identifiers

Parametrization and Data Driven Testing

Build Reusable Functions

Requirements

  • IntelliJ Installation
  • Java Basic Understanding
  • JUnit Installation

Description

UFT Developer helps you develop automated tests for a wide range of technologies, using standard IDEs with modern programming languages. UFT Developer requires familiarity with the basics of programming in the language you use to develop your tests.

Requirements prior course:

  • Install the UFT Developer runtime engine on any machine where you want to run UFT Developer tests.
  • Install one or more supported IDEs and the relevant UFT Developer plugins on any machine where you want to write and edit UFT Developer tests.

In this course, you will learn how to use UFT Developer for Java using IntelliJ and JUnit as testing framework.

In the IDE of your choice, create a UFT Developer testing project, use UFT Developer to create test object descriptions and write tests that can perform operations on your applications.

Create a testing project

Create a UFT Developer testing project in the IDE of your choice, using the project templates provided with the UFT Developer plugins or use your own custom framework.

Customize your test settings

Customize the UFT Developer runtime server settings and report options.

Define test objects

Create test object descriptions that enable UFT Developer to identify the objects in your application and can withstand changes in the application you’re testing.

Write programmatic descriptions or use the visually oriented tools that UFT Developer offers to provide an interface to the tested application and its objects.

Write tests

After you create test object descriptions, write automated tests whose steps call the methods and properties of these UFT Developer test objects.

Add code to verify application behavior

Verify that the objects in your application look and behave as you expect.

When these special steps return false results, the step and test fail, but no exception is thrown and your test continues to run.

This course will cover the following:

  • Build Application Models
  • Create Test Scripts
  • Running Test Scripts
  • Calculation and custom checkpoints
  • Output Values and Parametrization
  • Data Driven Testing
  • Visual Relation Identifiers
  • Using Reporter Object
  • Working with Test Recorder
  • Summary

Upon successful completion of this course, you will be eligible to:

  • be more productive
  • better collaborate
  • use agile methodologies in a smarter way
  • support the software delivery lifecycle
  • take on lead roles in your projects and advance in your career

Who this course is for:

  • Developers
  • Testers
  • Automation Engineers
  • Technical Testers

Course content

1 section • 9 lectures • 1h 43m total length

UFT Developer Basics for WPF Desktop Application9 lectures • 1hr 44min

  • Introduction03:20
  • Organize Application Models15:39
  • Building a Basic Test Script21:55
  • Calculation, Checkpoints and Output Values19:29
  • Parametrization and Data Driven Testing11:06
  • Working with Native Object Properties08:27
  • Using the Test Recorder05:43
  • Using Visual Relation Identifiers04:30
  • Additional Settings and Summary13:34

Unit Testing en C#

Unit testing automatizado

Requirements

  • Conocimientos de .Net/C#

Description

Este curso está destinado a programadores C# con poca o ninguna experiencia en la automatización de pruebas. Presenta los conceptos básicos de pruebas unitarias. Si bien se utiliza la herramienta NUnit todos los conceptos son perfectamente aplicables a otras herramientas como MSTest y xUnit sin mayores dificultades. Más aún, los conceptos también pueden extrapolarse fácilmente a herramientas de otras tecnologías como JUnit (java), RubyTest(ruby) y SUnit(smalltalk).

El curso consta de dos horas de video, repartidas en varios videos de no más de 10 minutos cada uno. Adicionalmente a los videos el curso provee un conjunto de recursos que incluyen lecturas complementarias y ejercicios de programación con sus respectivas soluciones para que puedas comparar con tu propia solución. El curso también puede ser de gran utilidad para programadores que ya tengan experiencia haciendo pruebas automatizadas ya que además de los conceptos fundacionales de la materia, se ofrecen también varias recomendaciones surgidas de la experiencia de haber trabajado por más de 15 años en la temática.

Si bien puedes hacer el curso al ritmo que gustes, mi recomendación para un aprendizaje efectivo es que planifiques para hacerlo en una  semana, reservando 4 bloques de 1 hora en los cuales alternes videos, lecturas y ejercicios. Es fundamental que hagas los ejercicios, son pocos, pero te ayudarán a afianzar los conceptos.

Who this course is for:

  • Desarrollo de .Net/C#

Course content

3 sections • 15 lectures • 1h 57m total lengthExpand all sections

Fundamentos7 lectures • 51min

  • Fundamentos de unit testing08:06
  • Un primer test sin framework de testing08:05
  • Hacia un framework de testing06:53
  • Primeros pasos con NUnit06:49
  • Posibles resultados de un test09:28
  • NUnit, VSCode & Rider03:08
  • Test Runner & Nunit Test Adapter08:20

Convenciones de NUnit4 lectures • 35min

  • Un ejemplo más real de NUnit10:30
  • Inicialización y finalización de test en NUnit06:57
  • Test de situaciones de excepción07:47
  • Tipos de Asserts09:17

Organización de casos de prueba4 lectures • 33min

  • Generación de Casos de Prueba con NUnit08:28
  • Agrupamiento de test en NUnit07:23
  • Consideraciones de diseño de Casos de Prueba07:11
  • Cierre y Siguientes pasos09:35

TestNG for Beginners

Learn about the functionalities of TestNG to start writing your own test cases with this free online coding course.

TestNG is a Java open-source testing framework inspired by JUnit with features that make it more flexible and easier to use. TestNG is a great tool for writing test cases and provides a vast number of functionalities. We cover many of these such as annotation, parallel execution, test grouping and more in this free programming course. You will also see how to create test methods and convert classes to test suites.

In This Free Course, You Will Learn How To

  • Use TestNG in a Java application
  • List and explain the functionalities of the TestNG framework
  • Recall the basic structure of test case writing and execution in the TestNG framework
  • Identify the different levels of annotations of TestNG and their applications
  • Execute test cases using a data provider
  • Create groups in TestNG and how to include or execute them during execution via XML file
  • Describe how a test case can be managed using the TestNG XML file
  • State why parallel execution is necessary in test case writing

Course Modules

MODULE 01

Introduction to Testng for Beginners

In this module, you will learn all the necessary functionalities you need to start creating test cases. We will start with an introduction to TestNG and its installation process and then proceed to create our first test case almost immediately. Learners will gain an understanding of annotations and how to apply them to sample test cases.

  • Introduction to TestNG – Learning Outcomes
  • TestNG Project Set-Up
  • First Test Case
  • TestNG Functionalities
  • Introduction to TestNG – Lesson Summary

MODULE 02

Course assessment

TestNG for Beginners – Course Assessment

Course Description

Have you ever been disappointed by software that didn’t work? Several factors may cause this, including the possibility that the company didn’t thoroughly test the product before it was released. Software testing is the process of finding out whether it meets the expected functionality it was developed for and making sure that the program is free of defects. TestNG is a testing framework for the Java programming language. It has key functionalities like annotation, test configuration, parallel execution, and test grouping, making it powerful and easy to use. TestNG covers unit, function, end-to-end and system testing. You can integrate it with any Java application by using Maven or Gradle dependencies, or adding a TestNG jar file directly in Java. This course provides a step-by-step guide on getting started with TestNG. We begin by introducing you to TestNG and its advantages over other frameworks. We will show you how to set up and install the TestNG library in any Maven-based project and use it with the Eclipse IDE. In addition, explore the basic structure of test case writing and execution in the TestNG framework. 

Annotation in TestNG provides information about its suite, method and class. It helps to define the execution approach of your test cases and the different features associated with them. If a method is not prefixed with annotations, it will be ignored and not executed as part of the test case. Gain insight into all the available annotations and apply them to your projects. We explore advanced annotation attributes and how to use them to change test case behaviors. One of the functionality TestNG provides is assertion; it offers many levels to validate your actual results against your expected results. We study the commonly used assertions and how you can use them to verify the correctness of a statement and data-driven testing using TestNG and Apache Commons CSV. 

A data provider in TestNG is a test case method that provides an array of varied actual values to dependent test methods. We discuss in detail how to execute test cases using external data, including how to use different providers and parameters. Reporting is crucial because the project stakeholders make decisions based on these reports, which must be precise and easy to read for everyone. We explore testing execution and reporting via TestNG Reports. You will understand key features of TestNG such as test grouping, test management via XML, parallel execution and how to use TestNG programmatically. This course is essential for beginners, developers and testers in test case creation. Due to TestNG’s ease of use, extra configuration, and advanced functionalities compared to its peers, it has become widely used by many developers worldwide. By the end of this course, you will have gained invaluable knowledge of software testing. So why wait? Enroll now.

Knowledge & Skills You Will Learn

  • Programming
  • Software Testing
  • Java
  • JUnit

Selenium Certification Training Course

Intellipaat’s Selenium Course is based on the online Automation Testing course which will help you become a certified Selenium Tester. As part of the Selenium training, you will learn components such as Selenium IDE, RC, Selenium WebDriver, and Selenium Grid through hands-on projects and case studies. Learn from industry experts and SME’s become certified with this Selenium certification course.

Selenium Certification Course Overview

Intellipaat online Selenium training helps you learn Selenium and become a certified Selenium Tester. As part of the course, you will learn Selenium components such as Selenium IDE, RC, Selenium WebDriver, and Selenium Grid through hands-on projects and case studies.

What will you learn in this Selenium online training?

You will be learning about the following topics in this Selenium certification training program:

  1. Advantages of Selenium automation testing
  2. Selenium RC
  3. Deploying Selenium IDE functions and commands
  4. Sikuli, JUnit, and the TestNG plugin in Eclipse
  5. Object repository and Maven
  6. Introduction to Selenium WebDriver
  7. Selenium WebDriver training programs, including Textbox, Checkbox, and multiple Windows
  8. Using Selenium Grid for software automation testing

What are the prerequisites for taking up this Selenium Course?

Having a basic knowledge of C or Java is beneficial but not mandatory for taking up this training. Anybody can learn Selenium. However, having basic level programming knowledge and IT background will help you to better grasp the concepts.

Why should you take up this best Selenium certification course?

You should learn this automation testing tool because:

  • The global software testing market to reach US$50 billion shorty – NASSCOM
  • Selenium supports more browsers and languages than any other testing tool
  • A Selenium Tester in the United States can earn around US$87,000 annually

Today, due to the ubiquity of software, testing them is of prime importance. Selenium tool is used for automation testing. Intellipaat is offering a comprehensive software automation testing course created by industry experts. Taking up this training program will help you rise in your career rapidly. Moreover, this Selenium certification issued by Intellipaat is well-recognized in the industry.

Selenium Certification Course Content

Module 01 – Core Java Concepts

1.1 Introduction to Java programming
1.2 Defining Java
1.3 Need for Java
1.4 Platform independence in Java
1.5 Defining JRE, JVM, and JDK
1.6 Important features and evolution of Java

Module 02 – Writing Java Programs Using Java Principles

2.1 What is object-oriented programming?
2.2 The concept of abstraction, attributes, methods, constructors, inheritance, encapsulation, and polymorphism
2.3 Overview of coding
2.4 Setting up the required environment
2.5 Knowing the available IDEs
2.6 Writing a basic-level Java program
2.7 Defining a package
2.8 What are Java comments?
2.9 Understanding the concept of Reserved Words
2.10 Introduction to Java statements
2.11 What are blocks in Java?
2.12 Classes and different methods

Module 03 – Getting Started with Selenium

3.1 Introduction to Selenium testing
3.2 Understanding the significance of automation testing
3.3 Benefits of Selenium automation testing
3.4 Comparison of Selenium and Quick Test Professional

Module 04 – Selenium Features

4.1 Understanding the Selenium Integrated Development Environment
4.2 The concept of Selenium Remote Control
4.3 Working with Selenium Grid
4.4 Selenium Web Grid

Module 05 – Deep Dive into Selenium IDE

5.1 Detailed understanding of the Selenium IDE features,
5.2 Addition of script assertions
5.3 General Selenese commands
5.4 Deploying the first Selenium script and options
5.5 IDE Test Suite, sample project IDE, and recording a Selenium test case
5.6 Selenium limitations

Hands-on Exercise:
1. Record a test case
2. Execute the first test case

Module 06 – Selenium WebDriver Automation

6.1 The basic architecture of Selenium WebDriver
6.2 Download and installation of Selenium
6.3 Creating a Java function and executing it

Hands-on Exercise:
1. Install Selenium WebDriver

Module 07 – Fire Path Installation

7.1 Deploying Web-Drivers for scripting
7.2 Getting the HTML source of Web Element, Table and Form Elements
7.3 FireBug extension and Fire Path installation

Hands-on Exercise:
1. Set up a Grid

Module 08 – Searching Elements

8.1 Locator and Locator-ID
8.2 Deploying searching elements using the link text and the name
8.3 Using XPath
8.4 Searching elements using CSS and Web-Element properties

Hands-on Exercise:
1. Deploy searching elements using the link text
2. Using the name
3. Using XPath
4. Search elements using CSS and Web-Element properties

Module 09 – Advanced User Interactions and Cross Browser Testing

9.1 Working with Advanced User Interactions
9.2 Understanding the various features, such as drag-and-drop, double click, keys, and context
9.3 Deploying Cross Browser Testing using WebDriver and executing tests in Chrome and Firefox

Hands-on Exercise:
1. Deploy and execute a test case for Chrome
2. Deploy and execute a test case for Firefox

Module 10 – Introduction to TestNG Plugin

10.1 Installation of the TestNG plugin in Eclipse
10.2 TestNG sample script and understanding Selenium test script writing
10.3 TestNG test suites creation and HTML and XML report generation using TestNG

Hands-on Exercise:

1. Install the TestNG plugin in Eclipse
2. Write a TestNG script and execute
3. Generate an HTML report
4. Generate an XML report

Module 11 – TestNG Terminology

11.1 Annotations, parameters, and groups: include and exclude
11.2 Test result and data providers

Hands-on Exercise:

1. Mark annotation group test results

Module 12 – TestNG Data Providers

12.1 TestNG data providers
12.2 Screenshot on failed test cases
12.3 Wait statements of Web Driver in Selenium
12.4 Wait in Selenium
12.5 Explicit wait and implicit wait in Selenium
12.6 Fluent wait in Selenium
12.7 Page load timeout

Hands-on Exercise:
1. Capture screenshot on a failed test case and setup wait timeout to wait for page load before resuming test execution

Module 13 – Maven Integration

13.1 Introduction to Maven
13.2 Maven usage
13.3 Configuring Maven with Eclipse
13.4 Taking automatic updates
13.5 Running tests in Maven
13.6 Creating a POM.xml file
13.7 Maven integration tool

Module 14 – WebDriver Sample Programs

14.1 Working with text box, button, link, checkbox, drop-down, and radio button
14.2 Selecting and displaying values
14.3 Writing all values in Notepad/Excel/WordPad
14.4 Capturing a screenshot (positive)
14.5 On load alerts and scroll down page in JavaScript
14.6 HTML Unit Driver
14.7 Managing multiple windows and AJAX auto suggestions
14.8 Managing web tables

Hands-on Exercise:

1. Use text box, button, checkbox, drop-down, and radio buttons
2. Display views
3. Capture a screenshot
4. Manage web tables

Module 15 – JUnit Operations and the Test Framework

15.1 Annotations in JUnit
15.2 Methods in JUnit
15.3 JUnit Test Suites
15.4 Ant Build and JUnit reporting
15.5 Test framework, data-driven framework, keyword-driven framework, and hybrid framework and the execution of the test case from the test framework

Hands-on Exercise:

1. Load an Excel file
2. Execute a test case using a data-driven framework
3. Execute a test case using the keyword-driven framework

Module 16 – Object Repository

16.1 Understanding object repository
16.2 Using OR in scripts
16.3 Learning sample scripts using object repository
16.4 Page object modeling
16.5 Page factory

Hands-on Exercise:

1. Use OR in scripts
2. Implement POM

Pragmatic Unit Testing in Java 8 with JUnit

Takeaway Skills

Learn how to effectively test Java applications using JUnit

Get to know the core quality principles of unit testing

Master writing cleaner and refactored JUnit tests

Course Overview

In this course, you will learn how to write a unit test for Java applications using JUnit. You’ll start by covering unit-testing foundations, which provide you with a starter set of information about writing basic tests in JUnit. You’ll learn about JUnit organization and assertions, and you’ll pick up a few core quality practices for unit testing such as the Right BICEP and the CORRECT way. Towards the end, the bigger design picture focuses on the relevance of design to unit testing and vice versa. You’ll refactor your tests, and you’ll learn how to use mock objects to deal with trouble-some dependencies.

Course Contents

  1. Before We Begin
  • Why This Course?
  • Course Structure
  • Why Unit Testing?

2. JUnit Test Foundations

  • Reasons to Write Unit Tests
  • Introduction to Building JUnit Test
  • Our First Passing Test
  • Arrange, Act, and Assert Your Way to a Test
  • Understanding What We’re Testing: The Profile Class
  • Let’s Write Tests
  • Initializing Tests with @Before Methods
  • Quiz on JUnit Test Bits

3. Digging Deeper into JUnit Assertions

  • Introduction to Assertions in JUnit
  • A Classic-Style Assertion: assertTrue
  • Hamcrest Assertions
  • Decorators
  • Comparing Two Floating-Point Numbers
  • Assertion Messages
  • Testing the Expected Exceptions
  • Expected Exceptions using JUnit
  • Quiz Time

4. Organizing Your Tests

  • Follow the AAA Pattern
  • Test Behaviors not Methods
  • Relationship Between Test and Production Code
  • Focused and Single-purpose Tests
  • Test Documentation
  • Using Annotations
  • Green Is Good
  • Quiz Time

5. Mastering Manic Mnemonics!

  • FIRST: Properties of Good Tests
  • [F]IRST: [F]ast
  • F[I]RST: [I]solate Your Tests
  • FI[R]ST: Good Tests Should Be [R]epeatable
  • FIR[S]T: [S]elf-Validating
  • FIRS[T]: [T]imely
  • Quiz Time

6. What to Test: The Right-BICEP

  • The Right-BICEP
  • [Right]-BICEP: Are the Results Right?
  • Right-[B]ICEP: Boundary Conditions
  • Right-B[I]CEP: Checking Inverse Relationships
  • Right-BI[C]EP: Cross-Checking Using Other Means
  • Right-BIC[E]P: Forcing Error Conditions
  • Right-BICE[P]: Performance Characteristics
  • Quiz time

7. Boundary Conditions: The CORRECT Way

  • The CORRECT Way
  • [C]ORRECT: [C]onformance
  • C[O]RRECT: [O]rdering
  • CO[R]RECT: [R]ange
  • COR[R]ECT: [R]eference
  • CORR[E][C]T: [C]ardinality and [E]xistence
  • CORREC[T]: [T]ime
  • Quiz time

8. The Bigger Design Picture

  • Refactoring to Cleaner Code
  • Finding Better Homes for Our Methods
  • Automated and Manual Refactorings
  • How much Refactoring?
  • Quiz time

9. Bigger Design Issues

  • SOLID class design principles
  • The SRP and Profile class
  • Command-query separation principle
  • Test Maintenance Cost
  • Other Design Thoughts
  • Quiz Time

10. Using Mock Objects

  • A Testing Challenge
  • Replacing Troublesome Behavior with Stubs
  • Changing Our Design to Support Testing
  • Simplifying Testing using a Mock Tool
  • One Last Simplification: Introducing an Injection Tool
  • What’s Important to Get Right When Using Mocks?
  • Quiz Time

11. Refactoring Tests

  • Searching for an Understanding
  • Test Smell: Unnecessary Test Code
  • Test Smell: Missing Abstractions
  • Test Smell: Irrelevant Information
  • Test Smell: Bloated Construction
  • Test Smell: Multiple Assertions
  • Test Smell: Irrelevant Details
  • Test Smell: Implicit Meaning and Misleading Organization
  • Adding a New Test
  • Quiz Time

12. The Bigger Unit-Testing Picture

  • Test-Driven Development
  • TDD Cycle
  • Smallest Possible Increment
  • Code Refactoring
  • Another Small Increment
  • Supporting Multiple Answers: A Small Design Detour
  • Expanding the Interface
  • Last Tests
  • Tests As Documentation
  • Quiz Time

13. Testing Some Tough Stuff

  • Testing Multithreaded Code
  • Extracting Application Logic
  • Redesigning the Threading Logic
  • Testing Databases
  • The Data Problem
  • Cleaning the Database and Mocking the Controller

14. Testing on a Project

  • Coming up to Speed
  • One Team, One Unit
  • Convergence with Continuous Integration
  • Code Coverage

15. Wrapping Up

  • Conclusion

16. Appendix – Setting up JUnit

  • IntelliJ IDEA
  • NetBeans

How You’ll Learn

Hands-on Coding Environments

You don’t get better at swimming by watching others. Coding is no different. Practice as you learn with live code environments inside your browser.

2x Faster Than Videos

Videos are holding you back. The average video tutorial is spoken at 150 words per minute, while you can read at 250. That‘s why our courses are text-based.

No Set-up Required

Start learning immediately instead of fiddling with SDKs and IDEs. It‘s all on the cloud.

Progress You Can Show

Built in assessments let you test your skills. Completion certificates let you show them off.

Black-box and White-box Testing

About this Course

After completing this course, learners will have an understanding of a variety of black-box and white-box testing techniques. The learner will have put this understanding into practice, creating effective sets of test cases (called a test suite) to properly exercise software for defect finding. The learner will have examined requirements for testability, created an oracle for automated testing, assessed fault-finding effectiveness of test suites, and generated inputs using a variety of techniques.

After completing this course, you will be able to: – evaluate testability of requirements – define testable units within a program specification – apply black-box test input selection methods – specifically boundary-value analysis, fuzzing, and random selection – and select the method most-suited to achieve the given testing objective – assess the fault-finding effectiveness of a functional test suite using mutation testing – use category partitioning to develop automated functional tests (with Cucumber) based on a given software specification – create an expected-value oracle from a program description to use within the generated tests In order to do well in this course, you should have experience with an OOP language (like Java), have an IDE installed (e.g., Eclipse), and be familiar with testing terminology (see Intro to Software Testing course within this specialization). we also expect a familiarity with the Software Development Lifecycle and the context in which the testing stage sits. This course is primarily aimed at those learners interested in any of the following roles: Software Engineer, Software Engineer in Test, Test Automation Engineer, DevOps Engineer, Software Developer, Programmer, Computer Enthusiast.

WHAT YOU WILL LEARN

  • You will evaluate testability of requirements
  • You will define testable units within a program specification
  • You will select and apply black-box test input selection methods, including boundary-value analysis, fuzzing, and random selection
  • You will develop automated tests and test oracles for automated software verification.

SKILLS YOU WILL GAIN

  • Executing Tests
  • Software Testing
  • Writing Tests
  • Cucumber
  • Junit

Syllabus – What you will learn from this course

WEEK1

4 hours to complete

Module 1: Introduction

In this module, we will learn about the basics of testing adequacy, as well as the factors that influence testing effectiveness and how we quantify these metrics.

  • Introduction to Test Selection and Test Adequacy6m
  • What are Test Obligations?11m
  • Factors Influencing Test Effectiveness9m
  • Program Structure: Reachability and Observability8m
  • Mutation Testing Revisited5m
  • Program Structure and Fault Finding6m
  • Test Oracles9mOracles and Fault Finding8m

1 reading

Welcome to the course!5m

7 practice exercises

Introduction to Test Adequacy30mFactors Influencing Test Effectiveness30mProgram Structure: Reachability and Observability30mMutation Testing Revisited30mProgram Structure and Fault Finding30mTest Oracles14mOracles and Fault Finding30m

WEEK2

5 hours to complete

Module 2: Black and White-box Techniques

In this module, we will learn a variety of testing techniques that can be used in both white-box and black-box testing strategies.


5 hours to complete

Module 2: Black and White-box Techniques

In this module, we will learn a variety of testing techniques that can be used in both white-box and black-box testing strategies.

  • Partition Testing10m
  • Combinatorial Testing12m
  • Requirements Coverage7m
  • Introduction to White-Box Testing Techniques11m
  • Code Coverage Metrics: Terminology5m
  • Code Coverage Metrics: Statement Coverage4m
  • Code Coverage Metrics: Branch Coverage4m
  • Code Coverage Metrics: Decision Coverage3m
  • Code Coverage Metrics: MC/DC10m
  • MC/DC Example6m
  • Code Coverage Metrics: OMC/DC12m
  • Code Coverage Metrics: Boundary Value6m
  • Mutation Testing Strategies6m
  • Test Metrics and Test Suite Effectiveness9m

7 practice exercises

Partition Testing30mCombinatorial Testing30mRequirements Coverage30mCode Coverage Metrics: Statement Coverage30mCode Coverage Metrics: Branch Coverage30mCode Coverage Metrics: Decision Coverage30mCode Coverage Metrics: MC/DC30m

WEEK3

9 hours to complete

Module 3: Requirements-Based Testing

In this module, we focus on requirements-based testing. We review a set of requirements from a testing perspective and then move on to a more sophisticated way of writing requirements: structured requirements using the tool Cucumber.


9 hours to complete

Module 3: Requirements-Based Testing

In this module, we focus on requirements-based testing. We review a set of requirements from a testing perspective and then move on to a more sophisticated way of writing requirements: structured requirements using the tool Cucumber.

  • Writing Requirements for Testability3m
  • Bad Requirements for Testability2m
  • Writing Test Cases for Requirements3m
  • “Fixed” Requirements for Testability1m
  • Introduction to User Stories and Behavior-Driven Development8m
  • Cucumber and Gherkin: An Overview5m
  • Cucumber Demo5m
  • Cucumber and Gherkin: How Does It Work?9m
  • Regular Expressions 10112m
  • Regular Expressions and Testing with Cucumber3m

7 practice exercises

Writing Requirements for Testability30mBad Requirements for Testability30mWriting Test Cases for Requirements30mFixing Requirements for Testability30mAre These Requirements Testable?30mIntroduction to User Stories and Behavior-Driven Development30mRegular Expressions 10130m

WEEK4

7 hours to complete

Performing Black and White Box Testing with Cucumber

In this module, we go further in using the Cucumber toolset in order to implement a variety of testing strategies against two example projects.

  • Mapping User Stories: the Microwave Example7m
  • Installing Cucumber and Configuring Eclipse Project10m
  • Creating Gherkin Scenarios and Step Definitions11m
  • Using Lists10mUsing Data Tables19m
  • Working with Scenario Outlines and Examples6m
  • Cucumber and Code Coverage12m