This document provides an introduction to test-driven development (TDD) using FlexUnit, an ActionScript unit testing framework. It discusses the benefits of TDD including enforcing modular design and simplifying integration testing. It then demonstrates a basic "Hello World" example of creating a Calculator class and corresponding test case class with a single test method to test the add() method. The key components of a test case class like setup, teardown, and annotation of test methods are also outlined.
Automating Interaction Testing with UML Sequence Diagrams: Where TDD and UML ...João Pascoal Faria
1) The document discusses automating interaction testing using UML sequence diagrams. Sequence diagrams can be used to specify tests by capturing message exchanges between objects.
2) An add-in for Enterprise Architect was created to generate JUnit test code from sequence diagrams. This allows modeling object interactions and automatically generating black-box and internal behavior tests.
3) The generated tests execute the specified method calls and parameter checks, as well as validating object creations and returns. Exceptions can also be tested. This provides a lightweight yet effective way to model and test object interactions.
This document provides an overview of JUnit 5 and its key features. It discusses:
- The main modules that make up JUnit 5 - JUnit Platform, JUnit Jupiter, and JUnit Vintage.
- How to write tests with JUnit Jupiter including annotations like @Test, extensions for lifecycle methods, parameterized tests, and assertions.
- Support for timeouts, exceptions, nested tests, and parameterized tests using various providers.
This presentation offers a complete overview of Qt Test, the Qt framework for unit testing.
It explains you how to create more stable and robust code by testing plain C++ code and Qt GUIs. It also covers advanced topics like data driven testing, Qt Creator integration and project organization.
This was part of the first Barcelona Qt Meetup.
This document discusses test-driven development and unit testing with JUnit. It covers:
- Writing tests before code using stubs, so code is testable and requirements are clear.
- Key aspects of JUnit like test classes, fixtures, assertions and annotations like @Before, @Test.
- Best practices like testing individual methods, writing simple tests first, and repeating the test-code cycle until all tests pass.
- Features of JUnit in Eclipse like generating test stubs from code and viewing test results.
The overall message is that testing saves significant time versus debugging, helps write better code, and is an essential part of the development process. Tests should cover all requirements and edge cases to
The document discusses JUnit 5, the next generation of the JUnit testing framework for Java. Key aspects include a new programming model using extensions, support for Java 8 features, and ways to migrate from earlier JUnit versions. The new framework consists of the JUnit Platform launcher, the JUnit Jupiter API for writing tests, and the JUnit Vintage engine for running JUnit 3 and 4 tests.
Links from the talk are available at:
https://github.com/claremacrae/talks/blob/master/Quickly_Testing_Qt_Desktop_Applications.md#top
Presented at Meeting C++ in Berlin on 15 November 2019.
Abstract: You've inherited some Qt GUI code: it's valuable, but it doesn't have tests, and it wasn't designed to be testable, so you need to start refactoring. But you can't refactor safely until the code has tests, and you can't add tests without refactoring! How can you ever break out of this loop?
Clare will review the challenges and potential sources of error that are specific to code that uses the Qt cross-platform graphical user interface library, and then describe how to guard against them.
There are many options for unit-testing Qt code, including Qt Test, Google Test and Catch. As well as covering those, and general principles for applying them, Clare will present a small but surprisingly effective C++11 library for applying "Approval Tests" to cross-platform Qt code.
Finally, she will briefly cover some other tools that can aid with inspecting and maintaining Qt code, which can in turn improve testability. Attendees will discover some quick, practical techniques to help write unit tests and integration tests for Qt code.
Unit testing with JUnit can be done using JUnit 3.x or 4.x frameworks. Key aspects include writing test cases as Java classes that extend TestCase and contain test methods starting with "test", using assertion methods like assertTrue and assertEquals to validate outcomes, and running tests from Eclipse. JUnit 4.x introduced annotations like @Before, @Test, and @After to respectively set up objects before each test, identify test methods, and tear down objects after tests.
This document provides an overview of JUnit, a unit testing framework for Java. It discusses how JUnit allows developers to write repeatable tests and test classes in a way that each test can run independently without affecting other tests. The document demonstrates how to write test cases using JUnit annotations and assertions for an AccountService class. It also covers test suites that group multiple test cases, the JUnit testing lifecycle using annotations, and dependencies needed to use JUnit.
Automating Interaction Testing with UML Sequence Diagrams: Where TDD and UML ...João Pascoal Faria
1) The document discusses automating interaction testing using UML sequence diagrams. Sequence diagrams can be used to specify tests by capturing message exchanges between objects.
2) An add-in for Enterprise Architect was created to generate JUnit test code from sequence diagrams. This allows modeling object interactions and automatically generating black-box and internal behavior tests.
3) The generated tests execute the specified method calls and parameter checks, as well as validating object creations and returns. Exceptions can also be tested. This provides a lightweight yet effective way to model and test object interactions.
This document provides an overview of JUnit 5 and its key features. It discusses:
- The main modules that make up JUnit 5 - JUnit Platform, JUnit Jupiter, and JUnit Vintage.
- How to write tests with JUnit Jupiter including annotations like @Test, extensions for lifecycle methods, parameterized tests, and assertions.
- Support for timeouts, exceptions, nested tests, and parameterized tests using various providers.
This presentation offers a complete overview of Qt Test, the Qt framework for unit testing.
It explains you how to create more stable and robust code by testing plain C++ code and Qt GUIs. It also covers advanced topics like data driven testing, Qt Creator integration and project organization.
This was part of the first Barcelona Qt Meetup.
This document discusses test-driven development and unit testing with JUnit. It covers:
- Writing tests before code using stubs, so code is testable and requirements are clear.
- Key aspects of JUnit like test classes, fixtures, assertions and annotations like @Before, @Test.
- Best practices like testing individual methods, writing simple tests first, and repeating the test-code cycle until all tests pass.
- Features of JUnit in Eclipse like generating test stubs from code and viewing test results.
The overall message is that testing saves significant time versus debugging, helps write better code, and is an essential part of the development process. Tests should cover all requirements and edge cases to
The document discusses JUnit 5, the next generation of the JUnit testing framework for Java. Key aspects include a new programming model using extensions, support for Java 8 features, and ways to migrate from earlier JUnit versions. The new framework consists of the JUnit Platform launcher, the JUnit Jupiter API for writing tests, and the JUnit Vintage engine for running JUnit 3 and 4 tests.
Links from the talk are available at:
https://github.com/claremacrae/talks/blob/master/Quickly_Testing_Qt_Desktop_Applications.md#top
Presented at Meeting C++ in Berlin on 15 November 2019.
Abstract: You've inherited some Qt GUI code: it's valuable, but it doesn't have tests, and it wasn't designed to be testable, so you need to start refactoring. But you can't refactor safely until the code has tests, and you can't add tests without refactoring! How can you ever break out of this loop?
Clare will review the challenges and potential sources of error that are specific to code that uses the Qt cross-platform graphical user interface library, and then describe how to guard against them.
There are many options for unit-testing Qt code, including Qt Test, Google Test and Catch. As well as covering those, and general principles for applying them, Clare will present a small but surprisingly effective C++11 library for applying "Approval Tests" to cross-platform Qt code.
Finally, she will briefly cover some other tools that can aid with inspecting and maintaining Qt code, which can in turn improve testability. Attendees will discover some quick, practical techniques to help write unit tests and integration tests for Qt code.
Unit testing with JUnit can be done using JUnit 3.x or 4.x frameworks. Key aspects include writing test cases as Java classes that extend TestCase and contain test methods starting with "test", using assertion methods like assertTrue and assertEquals to validate outcomes, and running tests from Eclipse. JUnit 4.x introduced annotations like @Before, @Test, and @After to respectively set up objects before each test, identify test methods, and tear down objects after tests.
This document provides an overview of JUnit, a unit testing framework for Java. It discusses how JUnit allows developers to write repeatable tests and test classes in a way that each test can run independently without affecting other tests. The document demonstrates how to write test cases using JUnit annotations and assertions for an AccountService class. It also covers test suites that group multiple test cases, the JUnit testing lifecycle using annotations, and dependencies needed to use JUnit.
The document discusses JUnit, a unit testing framework for Java. It provides an example of using JUnit to test a class called StaticCalculation that performs basic math operations like addition and multiplication. The tests check that the operations return the expected values. It also discusses how to create JUnit tests in Eclipse and integrate test cases into source code files.
A presentation on JUnit Pioneer given at Fortitude Technologies on Mar. 4, 2021. JUnit Pioneer is an extension library for JUnit 5 (Jupiter).
Sample code on GitHub at:
https://github.com/sleberknight/junit-pioneering-presentation-code
JUnit Pioneer home page:
https://junit-pioneer.org
The document provides an introduction and tutorial on using JUnit for unit testing Java code. It discusses problems that arise when developers do not properly test their code. It then demonstrates how to write and structure JUnit tests using examples of testing a Money class that represents currency values and a MoneyBag class that handles arithmetic across multiple currencies. Key aspects covered include writing test methods, using assertions to validate results, setting up test fixtures, defining test suites, and implementing a test-driven approach of writing small amounts of code and tests iteratively.
JUnit is a unit testing framework for Java that allows developers to write and run repeatable automated tests to determine whether changes introduce bugs. Key features include annotations to identify test methods, assertions to validate expected results, and test runners to execute tests. Tests are organized into classes following conventions like naming test classes with "Test" and methods with "test". JUnit provides components like fixtures, assertions, test suites, and rules to structure tests. It supports various testing scenarios including parameterized, ignored, timed, and exception tests.
TDD is a design technique where tests are written before code to determine requirements. The Red-Green-Refactor process is followed: 1) Write a test that fails (red), 2) Write minimum code to pass the test (green), 3) Refactor code. TDD ensures quality, keeps code simple and testable, and allows for rapid change. Writing tests first helps design by clarifying requirements and preventing bugs.
New and improved: Coming changes to the unittest modulePyCon Italia
The document discusses upcoming changes to the unittest testing framework in Python 2.7 and 3.2, including new assertion methods, type-specific equality functions, improved set and string comparison, and changes to command line behavior. Key changes are new assert methods, a delta parameter for assertAlmostEqual, deprecated aliases being removed, type-specific comparison functions, improved set and string handling, using assertRaises as a context manager, more command line options, and test discovery.
JUnit is a unit testing framework for Java that allows developers to write and run repeatable automated tests of Java code. Key aspects of JUnit include:
1. Tests are written by creating test classes that extend JUnit's TestCase class and contain test methods with names beginning with "test".
2. Tests use JUnit's assert methods like assertEquals to make assertions and determine whether the test passed or failed.
3. Annotations like @Before and @After allow setting up fixtures that run before and after each test.
4. The TestRunner class collects and runs all test cases and reports results.
5. Tests can be organized into test suites to group related tests and control execution
Quality assurance and testing are very important in a life cycle of any application. Although, by far not all developers understand the significance of tests.
In this presentation, we cover the basic testing practices for developers. The following tools are discussed: JUnit, Mockito, Hamcrest, JsTestDriver, DBUnit, Arquillian, SoapUI, Selenium.
JUnit is the de facto standard in Java testing. Yet many advanced JUnit features are little known and poorly understood. This session reviews some lesser-known features of JUnit, along with a few associated libraries, that can make your unit tests more powerful, expressive, and fun. The session is intended for Java developers, lead developers, and architects trying to introduce good testing practices into their teams.
This document provides an introduction to JUnit and Mockito for testing Java code. It discusses how to set up JUnit tests with annotations like @Before, @After, and @Test. It also covers using JUnit assertions and test suites. For Mockito, the document discusses how to create and use mock objects to stub behavior and verify interactions. It provides examples of argument matchers and consecutive stubbing in Mockito.
JUnit is an open source unit testing framework for Java applications. It was written by Erich Gamma and Kent Beck and is part of the xUnit family of unit testing frameworks. JUnit allows developers to write test cases that test individual classes and methods. These test cases can be grouped into test suites and run automatically to ensure code meets requirements and to catch errors early in the development process. JUnit includes annotations like @Test to identify test methods and asserts to validate method output. It integrates with development tools like Eclipse to provide test results.
The document discusses various unit testing frameworks for .NET such as MSTest v2, NUnit, and xUnit.net. It provides information on the key features of each framework, how to install and set them up, how to write tests, and comparisons between the frameworks. The document recommends NUnit as it has the richest set of assertions, supports data-driven testing well, and has full documentation available, which would be important for a new development team to learn to use the framework effectively.
Logic-based program transformation in symbiosis with EclipseCoen De Roover
"Logic-based program transformation in symbiosis with Eclipse" as presented at the 2011 Seminar Series on Advanced Techniques & Tools for Software Evolution in Koblenz.
This document provides an overview and tutorial on how to set up and use JUnit, a unit testing framework for Java. It discusses JUnit's features and environment setup, including downloading and configuring JUnit. It then covers writing and running basic JUnit tests, including creating test classes, methods, and runners. The document is intended for Java developers new to JUnit looking to learn its basic functionality and implementation.
This document provides code samples and documentation for the JActor library. It includes examples of basic actor concepts like hello world, actor-to-actor communication, parallel programming, dependency injection, and exception handling. Each example is broken down into the actor and request classes needed to demonstrate the concept.
The document provides details about QTP commands available through menus and toolbars to create, open, save, edit, run and manage tests. Key commands allow creating tests and components, opening existing tests, saving tests, editing steps, inserting checkpoints and scripts, recording and running tests, and managing test runs. QTP commands are accessible through menu options, toolbar buttons, and shortcut keys for important operations.
Unit testing involves writing small pieces of code to test specific functionality. Integration testing involves testing components together without full deployment. Spring Boot provides helpful tools for testing Spring applications, including test slices to load only parts of the configuration. The document discusses unit testing, integration testing, test patterns, test doubles, the Spring TestContext framework, and testing Spring Boot applications.
Hyper-pragmatic Pure FP testing with distage-testkit7mind
Having a proper test suite can turn ongoing application maintenance and development into pure joy – the best tests check meaningful properties, not the implementation details, and hold no impliict assumptions about their test environment - every test case must be self-contained and portable. To ensure that tests are free of implementation details and environment dependency, we may simply run them in a different test environment, with different implementations of components. But the boileplate and manual work involved in rewiring components, writing hardcoded fixtures and setting up different test environments make this very hard to do at scale. To tackle this problem we've created distage & distage-testkit, distage-testkit gives you the following superpowers:
* ability to easily swap out individual components or entire test environments
* principled & leak-free control of global resources for integration testing – docker containers, DBs, DDLs
* execute effects or allocate resources per-test, e.g. generate random fixtures per-test
* first-class testing of functional effects
* write tests as lambdas – access test fixtures via parameters or ZIO Environment
...and more! We'll also discuss general testing practices and what really distinguishes good tests from great tests.
The math syllabus outlines the policies and expectations for the course. Students will complete homework and notes at home, and work in class with the teacher. The grading policy is described, with letter grades corresponding to numerical scores. Students are expected to be on time, prepared with materials, and demonstrate respect. The curriculum will follow state standards and tools like online grading and other resources will be used. Any questions can be directed to the listed teachers.
This document provides an overview of how a math teacher structures their class into three stations where students rotate between reviewing notes, working on practice problems together, and completing projects or quizzes. The teacher emphasizes using timers to keep students on task and providing all materials and information to students through an online wiki or learning management system. Technology tools like projectors, document cameras, and online resources are leveraged to create and share video lessons and tutorials to replace traditional textbook and notes.
The document discusses JUnit, a unit testing framework for Java. It provides an example of using JUnit to test a class called StaticCalculation that performs basic math operations like addition and multiplication. The tests check that the operations return the expected values. It also discusses how to create JUnit tests in Eclipse and integrate test cases into source code files.
A presentation on JUnit Pioneer given at Fortitude Technologies on Mar. 4, 2021. JUnit Pioneer is an extension library for JUnit 5 (Jupiter).
Sample code on GitHub at:
https://github.com/sleberknight/junit-pioneering-presentation-code
JUnit Pioneer home page:
https://junit-pioneer.org
The document provides an introduction and tutorial on using JUnit for unit testing Java code. It discusses problems that arise when developers do not properly test their code. It then demonstrates how to write and structure JUnit tests using examples of testing a Money class that represents currency values and a MoneyBag class that handles arithmetic across multiple currencies. Key aspects covered include writing test methods, using assertions to validate results, setting up test fixtures, defining test suites, and implementing a test-driven approach of writing small amounts of code and tests iteratively.
JUnit is a unit testing framework for Java that allows developers to write and run repeatable automated tests to determine whether changes introduce bugs. Key features include annotations to identify test methods, assertions to validate expected results, and test runners to execute tests. Tests are organized into classes following conventions like naming test classes with "Test" and methods with "test". JUnit provides components like fixtures, assertions, test suites, and rules to structure tests. It supports various testing scenarios including parameterized, ignored, timed, and exception tests.
TDD is a design technique where tests are written before code to determine requirements. The Red-Green-Refactor process is followed: 1) Write a test that fails (red), 2) Write minimum code to pass the test (green), 3) Refactor code. TDD ensures quality, keeps code simple and testable, and allows for rapid change. Writing tests first helps design by clarifying requirements and preventing bugs.
New and improved: Coming changes to the unittest modulePyCon Italia
The document discusses upcoming changes to the unittest testing framework in Python 2.7 and 3.2, including new assertion methods, type-specific equality functions, improved set and string comparison, and changes to command line behavior. Key changes are new assert methods, a delta parameter for assertAlmostEqual, deprecated aliases being removed, type-specific comparison functions, improved set and string handling, using assertRaises as a context manager, more command line options, and test discovery.
JUnit is a unit testing framework for Java that allows developers to write and run repeatable automated tests of Java code. Key aspects of JUnit include:
1. Tests are written by creating test classes that extend JUnit's TestCase class and contain test methods with names beginning with "test".
2. Tests use JUnit's assert methods like assertEquals to make assertions and determine whether the test passed or failed.
3. Annotations like @Before and @After allow setting up fixtures that run before and after each test.
4. The TestRunner class collects and runs all test cases and reports results.
5. Tests can be organized into test suites to group related tests and control execution
Quality assurance and testing are very important in a life cycle of any application. Although, by far not all developers understand the significance of tests.
In this presentation, we cover the basic testing practices for developers. The following tools are discussed: JUnit, Mockito, Hamcrest, JsTestDriver, DBUnit, Arquillian, SoapUI, Selenium.
JUnit is the de facto standard in Java testing. Yet many advanced JUnit features are little known and poorly understood. This session reviews some lesser-known features of JUnit, along with a few associated libraries, that can make your unit tests more powerful, expressive, and fun. The session is intended for Java developers, lead developers, and architects trying to introduce good testing practices into their teams.
This document provides an introduction to JUnit and Mockito for testing Java code. It discusses how to set up JUnit tests with annotations like @Before, @After, and @Test. It also covers using JUnit assertions and test suites. For Mockito, the document discusses how to create and use mock objects to stub behavior and verify interactions. It provides examples of argument matchers and consecutive stubbing in Mockito.
JUnit is an open source unit testing framework for Java applications. It was written by Erich Gamma and Kent Beck and is part of the xUnit family of unit testing frameworks. JUnit allows developers to write test cases that test individual classes and methods. These test cases can be grouped into test suites and run automatically to ensure code meets requirements and to catch errors early in the development process. JUnit includes annotations like @Test to identify test methods and asserts to validate method output. It integrates with development tools like Eclipse to provide test results.
The document discusses various unit testing frameworks for .NET such as MSTest v2, NUnit, and xUnit.net. It provides information on the key features of each framework, how to install and set them up, how to write tests, and comparisons between the frameworks. The document recommends NUnit as it has the richest set of assertions, supports data-driven testing well, and has full documentation available, which would be important for a new development team to learn to use the framework effectively.
Logic-based program transformation in symbiosis with EclipseCoen De Roover
"Logic-based program transformation in symbiosis with Eclipse" as presented at the 2011 Seminar Series on Advanced Techniques & Tools for Software Evolution in Koblenz.
This document provides an overview and tutorial on how to set up and use JUnit, a unit testing framework for Java. It discusses JUnit's features and environment setup, including downloading and configuring JUnit. It then covers writing and running basic JUnit tests, including creating test classes, methods, and runners. The document is intended for Java developers new to JUnit looking to learn its basic functionality and implementation.
This document provides code samples and documentation for the JActor library. It includes examples of basic actor concepts like hello world, actor-to-actor communication, parallel programming, dependency injection, and exception handling. Each example is broken down into the actor and request classes needed to demonstrate the concept.
The document provides details about QTP commands available through menus and toolbars to create, open, save, edit, run and manage tests. Key commands allow creating tests and components, opening existing tests, saving tests, editing steps, inserting checkpoints and scripts, recording and running tests, and managing test runs. QTP commands are accessible through menu options, toolbar buttons, and shortcut keys for important operations.
Unit testing involves writing small pieces of code to test specific functionality. Integration testing involves testing components together without full deployment. Spring Boot provides helpful tools for testing Spring applications, including test slices to load only parts of the configuration. The document discusses unit testing, integration testing, test patterns, test doubles, the Spring TestContext framework, and testing Spring Boot applications.
Hyper-pragmatic Pure FP testing with distage-testkit7mind
Having a proper test suite can turn ongoing application maintenance and development into pure joy – the best tests check meaningful properties, not the implementation details, and hold no impliict assumptions about their test environment - every test case must be self-contained and portable. To ensure that tests are free of implementation details and environment dependency, we may simply run them in a different test environment, with different implementations of components. But the boileplate and manual work involved in rewiring components, writing hardcoded fixtures and setting up different test environments make this very hard to do at scale. To tackle this problem we've created distage & distage-testkit, distage-testkit gives you the following superpowers:
* ability to easily swap out individual components or entire test environments
* principled & leak-free control of global resources for integration testing – docker containers, DBs, DDLs
* execute effects or allocate resources per-test, e.g. generate random fixtures per-test
* first-class testing of functional effects
* write tests as lambdas – access test fixtures via parameters or ZIO Environment
...and more! We'll also discuss general testing practices and what really distinguishes good tests from great tests.
The math syllabus outlines the policies and expectations for the course. Students will complete homework and notes at home, and work in class with the teacher. The grading policy is described, with letter grades corresponding to numerical scores. Students are expected to be on time, prepared with materials, and demonstrate respect. The curriculum will follow state standards and tools like online grading and other resources will be used. Any questions can be directed to the listed teachers.
This document provides an overview of how a math teacher structures their class into three stations where students rotate between reviewing notes, working on practice problems together, and completing projects or quizzes. The teacher emphasizes using timers to keep students on task and providing all materials and information to students through an online wiki or learning management system. Technology tools like projectors, document cameras, and online resources are leveraged to create and share video lessons and tutorials to replace traditional textbook and notes.
The document provides a detailed itinerary for a 19-day, 3,019 mile road trip tour through the southern US visiting various sites related to the US Army Corps of Engineers. Key stops included Ladew Topiary Gardens in Maryland, the National D-Day Memorial in Virginia, various museums in North Carolina, Tennessee, Alabama, Mississippi, and Georgia showcasing local history and the Corps of Engineers.
This document proposes eliminating homework by having teachers record and share lesson videos for students to watch at home. It provides suggestions for creating lesson videos using document cameras, screen recording software, video cameras, and curating free videos from sites like YouTube and Khan Academy. Teachers could download videos to share on flash drives with students who lack internet. Recording lessons would allow students to re-watch and take notes at their own pace.
This document provides a detailed itinerary for a 16-day road trip touring Quebec, the Maritimes, and Prince Edward Island in a motorhome. Key stops included Quebec City, Fundy National Park, Peggy's Cove, Halifax, Baddeck, Cape Breton Highlands, Fortress of Louisbourg, Charlottetown, Cavendish, and St. John. The log entries describe touring landmarks, scenery, and experiences at each location along the route.
This document proposes using document cameras and screen recording technology to record lessons and notes for students to view at home, reducing the amount of homework. It provides examples of how different subjects could utilize these tools, including displaying textbooks and worksheets, demonstrating skills and experiments, and recording lectures. Tips are included for using free video platforms like YouTube, Vimeo, SchoolTube and Khan Academy when internet access is limited. The goal is to flip instruction so class time can be used for active learning and questions rather than note-taking.
This document provides a walkthrough of home model W115, which is a left side model with an optional enclosed patio. It includes exterior and interior photos of the entry, hallway, living/dining room, enclosed patio, kitchen, multi-purpose room, guest bedroom, master bedroom, master and guest/hall baths, laundry room, mud room, and garage. Additional expansion photos can be viewed online.
This document summarizes the specifications and features of a 1995 Roadtrek 190 Versatile Class B motorhome. It details the original factory specifications including the Chevrolet G30 van platform, engine, and other components. It also lists many custom modifications and additional items that were added by the owner, including fabricated storage solutions, a toaster oven installation, and other comfort and convenience upgrades. Photos are referenced showing some of the custom storage and organizational systems added to the interior of the vehicle.
The document describes various ways that a document camera ("doc cam") can be used in the classroom. It provides examples of uses for different subject areas like English, music, history, math, science, and health. It also discusses how the doc cam can be used to model skills, engage students, display materials, and facilitate peer-to-peer learning. Tips are given for recording lessons straight to a flash drive or computer using the doc cam software. Tools like the screen visor, spotlight, transparency mode, and split screen are explained.
Introduction to JUnit testing in OpenDaylightOpenDaylight
This document discusses JUnit testing frameworks for developers. It describes the goals of unit and integration testing using JUnit. It provides an overview of basic JUnit annotations like @Test and @Before. It also discusses three Maven plugins for unit, integration, and OSGi testing. Finally, it provides an example of using Mockito to mock dependencies in JUnit tests.
The document provides examples of various Java programming concepts like displaying messages, using control structures like if-else, for loops, methods, constructors, access specifiers, static variables and more. It shows how to write simple Java programs to print messages, integers, use conditional and looping statements. It also explains concepts like default and parameterized constructors, static and non-static methods, different access specifiers and their usage. The examples help learn how different Java features can be used to develop programs with classes, objects and methods.
The document provides an introduction to JUnit and Mockito frameworks for testing in Java. It covers key topics such as:
- What JUnit and Mockito are and how they are used for testing Java code
- Common JUnit annotations like @Test and how to structure test classes
- How to make assertions in JUnit tests to validate expected outcomes
- How to use Mockito to mock dependencies and define stubbed behavior
- Hands-on examples are provided to demonstrate writing tests with JUnit and Mockito
Test-driven development (TDD) involves writing unit tests before writing code to help ensure code quality and avoid omitted tests. The document discusses the NUnit testing framework for .NET, which uses attributes to identify test fixtures, methods, and setup/teardown functionality. It also covers how to write tests using assertions and run tests using the NUnit GUI or console applications.
This document provides an overview of JUnit, a unit testing framework for Java. It discusses JUnit's history and development by Kent Beck and others. The key aspects covered include: writing test cases by extending TestCase and adding test methods; using assertion methods like assertTrue and assertEquals to check conditions; organizing tests into test suites; and running JUnit tests within the Eclipse IDE. Other unit testing tools for other languages are also briefly mentioned.
A simple presentation that I did at work that goes over Unit Test, Mocking and TDD to improve development, it is explained from a Java perspective but can be helpful to apply TDD to other languages as well.
JUnit is an open source framework for writing and running tests in Java. It allows developers to write unit tests as they develop code to help find and fix bugs. JUnit provides tools to help keep tests organized, run tests automatically, and see results visually. Tests using JUnit isolate areas of code being tested and help ensure new code changes don't break existing code.
Unit Testing on Android involves testing individual units or components of code to find and fix bugs early. There are several test frameworks for Android like JUnit and Mockito that make unit testing easier. JUnit provides annotations to mark test methods and assertions to validate results. Mockito allows mocking dependencies to isolate and focus on the code being tested. Robolectric runs tests directly on a JVM without needing an emulator for faster testing. Code coverage tools like JaCoCo measure how much code is executed during tests.
Description (Part A) In this lab you will write a Queue implementati.pdfrishabjain5053
Description (Part A) In this lab you will write a Queue implementation called CoolQueue, which
closely matches the java.util.Queue collection, except with fewer methods. Test code is provided
that allows you to compare your queue to the one in java.util.Queue, which you can assume is
completely correct.
Getting Started
Create a project called Lab9 and download following files:
QueueInterface.java
TestProgram.java
CoolQueue.java
Fill in the supplied CoolQueue.java to make it implement the provided QueueInterface methods.
Then use the TestProgram to verify that your code works. Here are the methods in the interface:
public interface QueueInterface {
// Add object onto rear of queue
public abstract boolean add(E item);
// Remove object from front of queue // Throws NoSuchElementException if empty
public abstract E remove();
// Peek object from front of queue // Throws NoSuchElementException if empty
public abstract E element();
// Check for empty
public abstract boolean isEmpty();
// Returns size
public abstract int size();
// Clears queue
public abstract void clear();
// Various searches
public abstract boolean contains(Object o);
// Override toString
public abstract String toString(); }
Instructions
Inherit the interface provided above.
The Queue is a generic data structure, so declare an LinkedList.
HINT: You should use the first entry or head of the LinkedList as the front of the queue.
HINT: You should use the last entry or tail of the LinkedList as the rear of the queue.
You must not use add(), remove(), or element() in the LinkedList object.
You must implement toString() first, format is the same as LinkedList.toString().
Incremental development, so test one method at a time.
Review the TestProgram to see what is tested by each test number, 1 through 7.
Below is the CoolQueue.java:
import java.util.LinkedList;
import java.util.NoSuchElementException;
class CoolQueue implements QueueInterface {
// Underlying data structure
// Default constructor
}
Below is the TestProgram.java:
import java.util.LinkedList;
import java.util.NoSuchElementException;
import java.util.Queue;
import java.util.Random;
public class TestProgram {
static Random random = new Random();
public static void main(String[] args) {
// Make a Java stack
Queue javaQueue = new LinkedList<>();
// Make a student stack
CoolQueue coolQueue = new CoolQueue<>();
// Which test?
int testNumber = Integer.parseInt(args[0]);
switch (testNumber) {
case 1: // testAdd
System.err.println(\"testAdd: verifying add() method\");
pushRandom(javaQueue, 10);
pushRandom(coolQueue, 10);
System.err.println(\"Java Queue: \" + javaQueue);
System.err.println(\"Cool Queue: \" + coolQueue);
break;
case 2: // testRemove
System.err.println(\"testRemove: verifying remove() method\");
pushRandom(javaQueue, 10);
pushRandom(coolQueue, 10);
// Legal removes
for (int i = 0; i < 10; i++) {
System.err.printf(\"javaQueue.remove(): %4s, coolQueue.remove(): %4s\ \",
javaQueue.remove(), coolQueue.remove());
}
// Queue e.
Unit testing and integration testing are software testing techniques. Unit testing involves validating individual units or components of code work properly. Integration testing involves combining units and testing them together to find interface defects. An example integration test scenario described combining database scripts, application code, and GUI components developed separately into one system and verifying the interfaces. TestNG is a testing framework that supports features like dependency testing, grouping tests, and parameterization to make testing more powerful than JUnit.
Unit Testing with JUnit4 by Ravikiran JanardhanaRavikiran J
Unit testing with JUnit allows testing individual units of code, especially methods. JUnit provides annotations like @Test to mark test methods and assert methods to validate results. Tests can initialize objects and environment with @Before, validate outputs with assertEquals and other assert methods, and clean up with @After. Multiple test classes can be run together as a test suite with the @RunWith and @SuiteClasses annotations. JUnit is useful for finding bugs, ensuring code works as intended, and allowing test-driven development.
This document provides an overview of various testing frameworks and concepts used for Android testing. It discusses JUnit, Mockito, PowerMock, Robolectric, and Espresso - the most popular tools for unit, integration, and UI testing of Android apps. For each tool, it provides brief descriptions of their purpose and capabilities. It also includes examples demonstrating how to write tests using JUnit, Mockito, and PowerMock. The document aims to explain what these testing tools are and how they can be used for testing Android applications.
Unit Testing - Nakov's Talk @ VarnaConf 2013Svetlin Nakov
Unit testing involves writing small pieces of code called unit tests to test specific areas of functionality in code. A unit test verifies that a particular function or method works as expected. Frameworks like JUnit provide annotations and assertions to help write and organize unit tests. Unit tests should be written by developers and stored alongside the code being tested to ensure code quality.
Unit testing involves writing small pieces of code called unit tests to test specific areas of functionality in code. A unit test verifies that a particular function or method works as expected. Frameworks like JUnit provide annotations and assertions to help write and organize unit tests. Unit tests should be written by developers and stored alongside the code being tested to ensure code quality.
The document describes a code kata exercise to develop a StringCalculator application using test-driven development. It provides requirements for the add() method of the StringCalculator class and outlines composing tests to verify each requirement fails initially and then developing the code to pass all tests. The requirements include handling empty strings, delimiters, optional delimiters, negative numbers, and ignoring large numbers. The process of writing tests before code and verifying all tests pass is demonstrated.
This document discusses various tools and techniques for testing Python code, including:
- Unittest and doctest modules for writing and running tests
- The mocker library for creating mock objects in tests
- Nose for finding and running tests across files
- Twill for testing web applications through a command line interface
- Code coverage tools like Coverage for analyzing test coverage
- Continuous integration tools like Buildbot for running tests automatically
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor IvaniukFwdays
At this talk we will discuss DDoS protection tools and best practices, discuss network architectures and what AWS has to offer. Also, we will look into one of the largest DDoS attacks on Ukrainian infrastructure that happened in February 2022. We'll see, what techniques helped to keep the web resources available for Ukrainians and how AWS improved DDoS protection for all customers based on Ukraine experience
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving
Manufacturing custom quality metal nameplates and badges involves several standard operations. Processes include sheet prep, lithography, screening, coating, punch press and inspection. All decoration is completed in the flat sheet with adhesive and tooling operations following. The possibilities for creating unique durable nameplates are endless. How will you create your brand identity? We can help!
Must Know Postgres Extension for DBA and Developer during MigrationMydbops
Mydbops Opensource Database Meetup 16
Topic: Must-Know PostgreSQL Extensions for Developers and DBAs During Migration
Speaker: Deepak Mahto, Founder of DataCloudGaze Consulting
Date & Time: 8th June | 10 AM - 1 PM IST
Venue: Bangalore International Centre, Bangalore
Abstract: Discover how PostgreSQL extensions can be your secret weapon! This talk explores how key extensions enhance database capabilities and streamline the migration process for users moving from other relational databases like Oracle.
Key Takeaways:
* Learn about crucial extensions like oracle_fdw, pgtt, and pg_audit that ease migration complexities.
* Gain valuable strategies for implementing these extensions in PostgreSQL to achieve license freedom.
* Discover how these key extensions can empower both developers and DBAs during the migration process.
* Don't miss this chance to gain practical knowledge from an industry expert and stay updated on the latest open-source database trends.
Mydbops Managed Services specializes in taking the pain out of database management while optimizing performance. Since 2015, we have been providing top-notch support and assistance for the top three open-source databases: MySQL, MongoDB, and PostgreSQL.
Our team offers a wide range of services, including assistance, support, consulting, 24/7 operations, and expertise in all relevant technologies. We help organizations improve their database's performance, scalability, efficiency, and availability.
Contact us: info@mydbops.com
Visit: https://www.mydbops.com/
Follow us on LinkedIn: https://in.linkedin.com/company/mydbops
For more details and updates, please follow up the below links.
Meetup Page : https://www.meetup.com/mydbops-databa...
Twitter: https://twitter.com/mydbopsofficial
Blogs: https://www.mydbops.com/blog/
Facebook(Meta): https://www.facebook.com/mydbops/
Main news related to the CCS TSI 2023 (2023/1695)Jakub Marek
An English 🇬🇧 translation of a presentation to the speech I gave about the main changes brought by CCS TSI 2023 at the biggest Czech conference on Communications and signalling systems on Railways, which was held in Clarion Hotel Olomouc from 7th to 9th November 2023 (konferenceszt.cz). Attended by around 500 participants and 200 on-line followers.
The original Czech 🇨🇿 version of the presentation can be found here: https://www.slideshare.net/slideshow/hlavni-novinky-souvisejici-s-ccs-tsi-2023-2023-1695/269688092 .
The videorecording (in Czech) from the presentation is available here: https://youtu.be/WzjJWm4IyPk?si=SImb06tuXGb30BEH .
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyScyllaDB
Freshworks creates AI-boosted business software that helps employees work more efficiently and effectively. Managing data across multiple RDBMS and NoSQL databases was already a challenge at their current scale. To prepare for 10X growth, they knew it was time to rethink their database strategy. Learn how they architected a solution that would simplify scaling while keeping costs under control.
5th LF Energy Power Grid Model Meet-up SlidesDanBrown980551
5th Power Grid Model Meet-up
It is with great pleasure that we extend to you an invitation to the 5th Power Grid Model Meet-up, scheduled for 6th June 2024. This event will adopt a hybrid format, allowing participants to join us either through an online Mircosoft Teams session or in person at TU/e located at Den Dolech 2, Eindhoven, Netherlands. The meet-up will be hosted by Eindhoven University of Technology (TU/e), a research university specializing in engineering science & technology.
Power Grid Model
The global energy transition is placing new and unprecedented demands on Distribution System Operators (DSOs). Alongside upgrades to grid capacity, processes such as digitization, capacity optimization, and congestion management are becoming vital for delivering reliable services.
Power Grid Model is an open source project from Linux Foundation Energy and provides a calculation engine that is increasingly essential for DSOs. It offers a standards-based foundation enabling real-time power systems analysis, simulations of electrical power grids, and sophisticated what-if analysis. In addition, it enables in-depth studies and analysis of the electrical power grid’s behavior and performance. This comprehensive model incorporates essential factors such as power generation capacity, electrical losses, voltage levels, power flows, and system stability.
Power Grid Model is currently being applied in a wide variety of use cases, including grid planning, expansion, reliability, and congestion studies. It can also help in analyzing the impact of renewable energy integration, assessing the effects of disturbances or faults, and developing strategies for grid control and optimization.
What to expect
For the upcoming meetup we are organizing, we have an exciting lineup of activities planned:
-Insightful presentations covering two practical applications of the Power Grid Model.
-An update on the latest advancements in Power Grid -Model technology during the first and second quarters of 2024.
-An interactive brainstorming session to discuss and propose new feature requests.
-An opportunity to connect with fellow Power Grid Model enthusiasts and users.
Introduction of Cybersecurity with OSS at Code Europe 2024Hiroshi SHIBATA
I develop the Ruby programming language, RubyGems, and Bundler, which are package managers for Ruby. Today, I will introduce how to enhance the security of your application using open-source software (OSS) examples from Ruby and RubyGems.
The first topic is CVE (Common Vulnerabilities and Exposures). I have published CVEs many times. But what exactly is a CVE? I'll provide a basic understanding of CVEs and explain how to detect and handle vulnerabilities in OSS.
Next, let's discuss package managers. Package managers play a critical role in the OSS ecosystem. I'll explain how to manage library dependencies in your application.
I'll share insights into how the Ruby and RubyGems core team works to keep our ecosystem safe. By the end of this talk, you'll have a better understanding of how to safeguard your code.
Essentials of Automations: Exploring Attributes & Automation ParametersSafe Software
Building automations in FME Flow can save time, money, and help businesses scale by eliminating data silos and providing data to stakeholders in real-time. One essential component to orchestrating complex automations is the use of attributes & automation parameters (both formerly known as “keys”). In fact, it’s unlikely you’ll ever build an Automation without using these components, but what exactly are they?
Attributes & automation parameters enable the automation author to pass data values from one automation component to the next. During this webinar, our FME Flow Specialists will cover leveraging the three types of these output attributes & parameters in FME Flow: Event, Custom, and Automation. As a bonus, they’ll also be making use of the Split-Merge Block functionality.
You’ll leave this webinar with a better understanding of how to maximize the potential of automations by making use of attributes & automation parameters, with the ultimate goal of setting your enterprise integration workflows up on autopilot.
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...Alex Pruden
Folding is a recent technique for building efficient recursive SNARKs. Several elegant folding protocols have been proposed, such as Nova, Supernova, Hypernova, Protostar, and others. However, all of them rely on an additively homomorphic commitment scheme based on discrete log, and are therefore not post-quantum secure. In this work we present LatticeFold, the first lattice-based folding protocol based on the Module SIS problem. This folding protocol naturally leads to an efficient recursive lattice-based SNARK and an efficient PCD scheme. LatticeFold supports folding low-degree relations, such as R1CS, as well as high-degree relations, such as CCS. The key challenge is to construct a secure folding protocol that works with the Ajtai commitment scheme. The difficulty, is ensuring that extracted witnesses are low norm through many rounds of folding. We present a novel technique using the sumcheck protocol to ensure that extracted witnesses are always low norm no matter how many rounds of folding are used. Our evaluation of the final proof system suggests that it is as performant as Hypernova, while providing post-quantum security.
Paper Link: https://eprint.iacr.org/2024/257
In the realm of cybersecurity, offensive security practices act as a critical shield. By simulating real-world attacks in a controlled environment, these techniques expose vulnerabilities before malicious actors can exploit them. This proactive approach allows manufacturers to identify and fix weaknesses, significantly enhancing system security.
This presentation delves into the development of a system designed to mimic Galileo's Open Service signal using software-defined radio (SDR) technology. We'll begin with a foundational overview of both Global Navigation Satellite Systems (GNSS) and the intricacies of digital signal processing.
The presentation culminates in a live demonstration. We'll showcase the manipulation of Galileo's Open Service pilot signal, simulating an attack on various software and hardware systems. This practical demonstration serves to highlight the potential consequences of unaddressed vulnerabilities, emphasizing the importance of offensive security practices in safeguarding critical infrastructure.
How information systems are built or acquired puts information, which is what they should be about, in a secondary place. Our language adapted accordingly, and we no longer talk about information systems but applications. Applications evolved in a way to break data into diverse fragments, tightly coupled with applications and expensive to integrate. The result is technical debt, which is re-paid by taking even bigger "loans", resulting in an ever-increasing technical debt. Software engineering and procurement practices work in sync with market forces to maintain this trend. This talk demonstrates how natural this situation is. The question is: can something be done to reverse the trend?
Conversational agents, or chatbots, are increasingly used to access all sorts of services using natural language. While open-domain chatbots - like ChatGPT - can converse on any topic, task-oriented chatbots - the focus of this paper - are designed for specific tasks, like booking a flight, obtaining customer support, or setting an appointment. Like any other software, task-oriented chatbots need to be properly tested, usually by defining and executing test scenarios (i.e., sequences of user-chatbot interactions). However, there is currently a lack of methods to quantify the completeness and strength of such test scenarios, which can lead to low-quality tests, and hence to buggy chatbots.
To fill this gap, we propose adapting mutation testing (MuT) for task-oriented chatbots. To this end, we introduce a set of mutation operators that emulate faults in chatbot designs, an architecture that enables MuT on chatbots built using heterogeneous technologies, and a practical realisation as an Eclipse plugin. Moreover, we evaluate the applicability, effectiveness and efficiency of our approach on open-source chatbots, with promising results.
For the full video of this presentation, please visit: https://www.edge-ai-vision.com/2024/06/temporal-event-neural-networks-a-more-efficient-alternative-to-the-transformer-a-presentation-from-brainchip/
Chris Jones, Director of Product Management at BrainChip , presents the “Temporal Event Neural Networks: A More Efficient Alternative to the Transformer” tutorial at the May 2024 Embedded Vision Summit.
The expansion of AI services necessitates enhanced computational capabilities on edge devices. Temporal Event Neural Networks (TENNs), developed by BrainChip, represent a novel and highly efficient state-space network. TENNs demonstrate exceptional proficiency in handling multi-dimensional streaming data, facilitating advancements in object detection, action recognition, speech enhancement and language model/sequence generation. Through the utilization of polynomial-based continuous convolutions, TENNs streamline models, expedite training processes and significantly diminish memory requirements, achieving notable reductions of up to 50x in parameters and 5,000x in energy consumption compared to prevailing methodologies like transformers.
Integration with BrainChip’s Akida neuromorphic hardware IP further enhances TENNs’ capabilities, enabling the realization of highly capable, portable and passively cooled edge devices. This presentation delves into the technical innovations underlying TENNs, presents real-world benchmarks, and elucidates how this cutting-edge approach is positioned to revolutionize edge AI across diverse applications.
Fueling AI with Great Data with Airbyte WebinarZilliz
This talk will focus on how to collect data from a variety of sources, leveraging this data for RAG and other GenAI use cases, and finally charting your course to productionalization.
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...DanBrown980551
This LF Energy webinar took place June 20, 2024. It featured:
-Alex Thornton, LF Energy
-Hallie Cramer, Google
-Daniel Roesler, UtilityAPI
-Henry Richardson, WattTime
In response to the urgency and scale required to effectively address climate change, open source solutions offer significant potential for driving innovation and progress. Currently, there is a growing demand for standardization and interoperability in energy data and modeling. Open source standards and specifications within the energy sector can also alleviate challenges associated with data fragmentation, transparency, and accessibility. At the same time, it is crucial to consider privacy and security concerns throughout the development of open source platforms.
This webinar will delve into the motivations behind establishing LF Energy’s Carbon Data Specification Consortium. It will provide an overview of the draft specifications and the ongoing progress made by the respective working groups.
Three primary specifications will be discussed:
-Discovery and client registration, emphasizing transparent processes and secure and private access
-Customer data, centering around customer tariffs, bills, energy usage, and full consumption disclosure
-Power systems data, focusing on grid data, inclusive of transmission and distribution networks, generation, intergrid power flows, and market settlement data
4. Why?
TDD is like Source Control you don’t know how
much you need it until you start using it.
5. Benefits?
• Test first approach is Aspect Driven
• Enforces the developer to be the first consumer of
their own program
• Makes it easy to Refactor
• Simplifies Integration Testing
• Unit tests are living documentation of the system
• Encourages modular design
• Gives greater level of confidence in the code
• Reduces debugging time
6. Terminology
Assertion Test Case
true false statements that are used to verify the a set of conditions to determine the correctness of some
behavior of the unit functionalities of program
Test Suite Fixture
a set of tests that all share the same fixture all the things that must be in place in order to run a test
Code Coverage Fakes & Mocks
Dummy objects that simulates the behavior of complex,
percentage of a program tested by by a test suite
real objects
7. Phases of a Test
Set Up Exercise
setting up the test interact with the system under
fixture test
Blank State
Tear Down Verify
determine whether the
tear down the test fixture to
expected outcome has been
return to the original state
obtained
8.
9. What?
• A unit testing framework for Flex and
ActionScript.
• Similar to JUnit - the original Java unit testing
framework.
• Comes with a graphical test runner.
• Can test both Flex and AS3 projects
10. Let’s try a “Hello
World” unit test using
FlexUnit
13. 2. Create a new method
package
{
import flash.display.Sprite;
public class Calculator extends Sprite
{
public function Calculator()
{
}
public function add(x:int, y:int):int
{
return 0;
}
}
}
17. package flexUnitTests
{
import flexunit.framework.Assert;
3. Create a
public class CalculatorTest
{
test case class
[Before]
public function setUp():void
{
}
[After]
public function tearDown():void
{
}
[BeforeClass]
public static function setUpBeforeClass():void
{
}
[AfterClass]
public static function tearDownAfterClass():void
{
}
[Test]
public function testAdd():void
{
Assert.fail("Test method Not yet implemented");
}
}
}
18. package flexUnitTests
{
import flexunit.framework.Assert;
public class CalculatorTest
{
4. Create a
private var calculator:Calculator;
failing test case
[Before]
public function setUp():void
{
calculator = new Calculator();
}
[After]
public function tearDown():void
{
}
[BeforeClass]
public static function setUpBeforeClass():void
{
}
[AfterClass]
public static function tearDownAfterClass():void
{
}
[Test]
public function testAdd():void
{
Assert.assertEquals(calculator.add(2, 3), 5);
}
}
22. 6. Write the body of the method
package
{
import flash.display.Sprite;
public class Calculator extends Sprite
{
public function Calculator()
{
}
public function add(x:int, y:int):int
{
return x+y;
}
}
}
27. package flexUnitTests
{
import flexunit.framework.Assert;
public class CalculatorTest
{
Components of
private var calculator:Calculator;
a Test Case Class
[Before]
public function setUp():void
{
calculator = new Calculator();
}
[After]
public function tearDown():void
{
}
[BeforeClass]
public static function setUpBeforeClass():void
{
}
[AfterClass]
public static function tearDownAfterClass():void
{
}
[Test]
public function testAdd():void
{
Assert.assertEquals(calculator.add(2, 3), 5);
}
}
28. package flexUnitTests
{
import flexunit.framework.Assert;
public class CalculatorTest
{
Components of
private var calculator:Calculator;
a Test Case Class
[Before]
public function setUp():void
{
calculator = new Calculator();
}
[After]
public function tearDown():void
{
}
[BeforeClass]
public static function setUpBeforeClass():void
{
}
[AfterClass]
public static function tearDownAfterClass():void
{
}
[Test]
public function testAdd():void
{
Assert.assertEquals(calculator.add(2, 3), 5);
}
}
29. package flexUnitTests
{
import flexunit.framework.Assert;
public class CalculatorTest
{
Components of
private var calculator:Calculator;
a Test Case Class
[Before]
public function setUp():void
{
calculator = new Calculator();
}
[After]
public function tearDown():void
{
}
[BeforeClass]
public static function setUpBeforeClass():void
{
}
[AfterClass]
public static function tearDownAfterClass():void
{
}
[Test]
public function testAdd():void
{
Assert.assertEquals(calculator.add(2, 3), 5);
}
}
30. package flexUnitTests
{
import flexunit.framework.Assert;
public class CalculatorTest
{
Components of
private var calculator:Calculator;
a Test Case Class
[Before]
public function setUp():void
{
calculator = new Calculator();
}
[After]
public function tearDown():void
{
}
[BeforeClass]
public static function setUpBeforeClass():void
{
}
[AfterClass]
public static function tearDownAfterClass():void
{
}
[Test]
public function testAdd():void
{
Assert.assertEquals(calculator.add(2, 3), 5);
}
}
31. Test Suite Class
package flexUnitTests
{
import flexUnitTests.CalculatorTest;
[Suite]
[RunWith("org.flexunit.runners.Suite")]
public class CalculatorTestSuite
{
public var test1:flexUnitTests.CalculatorTest;
}
}
32. Myths
• TDD is a Golden Hammer
• We will not need Testers any more
• TDD eradicates bugs from the code
• TDD ensures that the code is up to the
requirement
33. Facts
• Don’t expect TDD to solve all of your
problems.
• TDD reduces the amount of QA but we will
still need Testers :)
• TDD may reduce number of bugs
• Tests might share the same blind spots as
your code because of misunderstanding of
requirements.
34. Useful Links
• FlexUnit
http://www.flexunit.org/
• FlexUnit 4.0
http://docs.flexunit.org/index.php?title=Main_Page
• A brief and beautiful overview of FlexUnit
http://www.digitalprimates.net/author/codeslinger/2009/05/03/
flexunit-4-in-360-seconds/
• A very good read
http://www.amazon.com/Working-Effectively-Legacy-Michael-
Feathers/dp/0131177052