Automated Testing Environment

Slides:



Advertisements
Similar presentations
xUnit Test Patterns (Some) xUnit Test Patterns (in practice) by Adam Czepil.
Advertisements

Over-view of Lab. 1 For more details – see the Lab. 1 web-site There will be a 20 min prelab quiz (based on Assignment 1 and 2) at the start of the lab.
Blackfin BF533 EZ-KIT Control The O in I/O Activating a FLASH memory “output line” Part 2.
6/2/2015 Concept of Test Driven Development applied to Embedded Systems M. Smith University of Calgary, Canada 1 Automated Testing Environment Concepts.
More Example Blackfin Code Using the E-UNITTest Framework.
Lab. 2 – More details – Tasks 4 to 6 1. What concepts are you expected to understand after the Lab. 2 is finished? 2. How do you demonstrate that you have.
TigerSHARC Laboratory Setting up the HPP-ICE environment ICT 318 / 320 Running versions of the Audio-talk-through program.
Lab. 2 Overview 1. What concepts are you expected to understand after the Lab. 2 is finished? 2. How do you demonstrate that you have that knowledge?
VisualDSP++ and Test Driven Development Prelaboratory assignment information.
Getting the O in I/O to work on a typical microcontroller Ideas of how to send output signals to the radio controlled car. The theory behind the LED controller.
Laboratory 1 – ENCM415 Familiarization with the Analog Devices’ VisualDSP++ Integrated Development Environment.
Just enough information to program a Blackfin Familiarization assignment for the Analog Devices’ VisualDSP++ Integrated Development Environment.
Introduction To C++ Programming 1.0 Basic C++ Program Structure 2.0 Program Control 3.0 Array And Structures 4.0 Function 5.0 Pointer 6.0 Secure Programming.
G51FSE Version Control Naisan Benatar. Lecture 5 - Version Control 2 On today’s menu... The problems with lots of code and lots of people Version control.
1 ENG236: ENG236: C++ Programming Environment (2) Rocky K. C. Chang THE HONG KONG POLYTECHNIC UNIVERSITY.
Phoenix Software Projects Larry Beaty © 2007 Larry Beaty. Copying and distribution of this document is permitted in any medium, provided this notice is.
Design and Programming Chapter 7 Applied Software Project Management, Stellman & Greene See also:
Just as there are many human languages, there are many computer programming languages that can be used to develop software. Some are named after people,
Testing. 2 Overview Testing and debugging are important activities in software development. Techniques and tools are introduced. Material borrowed here.
TigerSHARC Laboratory Setting up the HPP-ICE environment ICT 318 / 320 Running versions of the Audio-talk-through program.
Generating “Rectify( )” Test driven development approach to TigerSHARC assembly code production Assembly code examples Part 1 of 3.
Lab. 2 Overview Move the tasks you developed in Lab. 1 into the more controllable TTCOS operating system Manual control of RC car.
Moving Arrays -- 1 Completion of ideas needed for a general and complete program Final concepts needed for Final Review for Final – Loop efficiency.
Blackfin Array Handling Part 1 Making an array of Zeros void MakeZeroASM(int foo[ ], int N);
Mistakes, Errors and Defects. 12/7/2015Mistakes, Errors, Defects, Copyright M. Smith, ECE, University of Calgary, Canada 2 Basic Concepts  You are building.
JUnit Don Braffitt Updated: 10-Jun-2011.
12/14/2015 Concept of Test Driven Development applied to Embedded Systems M. Smith University of Calgary, Canada 1 Automated Testing Environment Concepts.
Scalatest. 2 Test-Driven Development (TDD) TDD is a technique in which you write the tests before you write the code you want to test This seems backward,
Constructive Computer Architecture Tutorial 4: Running and Debugging SMIPS Andy Wright TA October 10, 2014http://csg.csail.mit.edu/6.175T04-1.
Introduction Chapter 1 1/22/16. Check zyBooks Completion Click on the boxes for each section.
CHAPTER 3 COMPLETING THE PROBLEM- SOLVING PROCESS AND GETTING STARTED WITH C++ An Introduction to Programming with C++ Fifth Edition.
Text2PTO: Modernizing Patent Application Filing A Proposal for Submitting Text Applications to the USPTO.
FOP: Multi-Screen Apps
421 Review Questions Does software engineering add documentation that slows down the project? Is there one software process that is better than the others.
Chapter 8 – Software Testing
Microsoft Access Illustrated
Unit testing C# classes
Some Important Techniques For Regression Testing That You Must Know.
Testing UW CSE 160 Spring 2018.
Moving Arrays -- 1 Completion of ideas needed for a general and complete program Final concepts needed for Final Review for Final – Loop efficiency.
Lab. 2 Overview – Earlier Tasks Prelaboratory T1, T3, T4 and T5
TRANSLATORS AND IDEs Key Revision Points.
Generating “Rectify( )”
A Play Core Timer Interrupts
Introduction to Test Driven Development
Testing and Test-Driven Development CSC 4700 Software Engineering
Understanding the TigerSHARC ALU pipeline
Handling Arrays Completion of ideas needed for a general and complete program Final concepts needed for Final.
TigerSHARC processor and evaluation board
Lab. 2 – More details – Later tasks
VisualDSP++ and Test Driven Development What happened last lecture?
Moving Arrays -- 1 Completion of ideas needed for a general and complete program Final concepts needed for Final Review for Final – Loop efficiency.
Using Arrays Completion of ideas needed for a general and complete program Final concepts needed for Final.
A Play Lab. 2 Task 8 Core Timer Interrupts
CSE 303 Concepts and Tools for Software Development
Programming.
Handling Arrays Completion of ideas needed for a general and complete program Final concepts needed for Final.
* M. R. Smith 07/16/96 This presentation will probably involve audience discussion, which will create action items. Use PowerPoint.
Getting serious about “going fast” on the TigerSHARC
Concept of TDD Test Driven Development
Explaining issues with DCremoval( )
Handling Arrays Completion of ideas needed for a general and complete program Final concepts needed for Final.
Lecture 8 Programming Paradigm & Languages. Programming Languages The process of telling the computer what to do Also known as coding.
Lab. 2 Overview Move the tasks you developed in Lab. 1 into the more controllable TTCOS operating system.
Mistakes, Errors and Defects
A first attempt at learning about optimizing the TigerSHARC code
An Overview of C.
Working with the Compute Block
Building tests and code for a “software radio”
Presentation transcript:

Automated Testing Environment Concepts required for testing embedded systems adopted in this course (quizzes, assignments and laboratories) 11/24/2018 Concept of Test Driven Development applied to Embedded Systems M. Smith University of Calgary, Canada

To be tackled today Why test, and what kinds of tests are there? Difference between TLD – Test Last Development TDD – Test Driven Development (Test First Development) How do you add tests? More details on the testing process E-TDD and the testing toll E-UNIT Other kinds of available tests – time and access Design of custom TESTs and ASSERTS 11/24/2018 Concept of Test Driven Development applied to Embedded Systems M. Smith University of Calgary, Canada

Why test? Unit test I AM CURRENTLY BUILDING A NEW FUNCTION – does it work the way I expect? Testing my and my partner’s understanding of the Design WE ARE DESIGNING A NEW PRODUCT -- If we can’t explain (to ourselves via a test) the product ideas – how do we know when product is working? Regression testing MY PARTNER ADDED A NEW FEATURE to a product – how do I know it did not “break something” I wrote? System testing How do I PROVE TO THE CUSTOMER that the product (Lab. or assignment) works the way that was requested? 11/24/2018 Concept of Test Driven Development applied to Embedded Systems M. Smith University of Calgary, Canada

What are the problems with this sort of “Human intervention” test? This code is placed in Assignments1 directory 11/24/2018 Concept of Test Driven Development applied to Embedded Systems M. Smith University of Calgary, Canada

VisualDSP development environment (IDDE) – Communication overhead Debugging Interface “JTAG” boundary scan operation Processor Peripherals VisualDSP++ program Debugging Interface HPPCIce Lab. station (ICT318 / 320) BF533 Evaluation Board Each time we want to send a message (via printf( ) or cout) we must “stop” the processor from doing what we want it to do, and then send messages over the interface – Slow, plus the testing can impact on peripheral performance. E.g. no sound while doing printing in Assignment 2 and Lab. 1 11/24/2018 Concept of Test Driven Development applied to Embedded Systems M. Smith University of Calgary, Canada

More issues with this sort of test! Tests are mixed up “with production code” Must remove tests before release to customer Unreliable – may result in test messages at wrong time in released code Difficult to “add” and “remove tests” Can’t be automated – therefore unlikely to have tests run often during development – leads to unreliable product 11/24/2018 Concept of Test Driven Development applied to Embedded Systems M. Smith University of Calgary, Canada

E-TDD Tool E-TDD – embedded test driven development Build-the-tests-first (during design) ideas for product development has been made popular by the “Agile” approach Requires an automated testing approach (test framework) In this class, we are going to use the E-Unit tool for its automated behaviour Will use in both “test last” development (what most people currently do) and in “test first” development. I (the customer) will provide tests so that you can check that you have developed the “right” stuff at the “high” level You will build additional tests to check your own code at the “low level” 11/24/2018 Concept of Test Driven Development applied to Embedded Systems M. Smith University of Calgary, Canada

Test Environment Can download “LabTestEnvironment.zip” file from the web (Check the September webpages for exact name of file) LabX directory is where you keep your “project” code LabXcode_main.cpp LabX_start.cpp LabX_initializeASM.asm LabXTests is where you keep the tests for LabX LabXtests_main.cpp (built by GUI) Tests_for_LabX_start.cpp Tests_for_LabX_initializeASM.cpp written in C++) E_UnitConnect.cpp (built by GUI) 11/24/2018 Concept of Test Driven Development applied to Embedded Systems M. Smith University of Calgary, Canada

Build a new VDSP project “Assignment1Test” and place in “AssignmentTests” directory Now add certain standard files to the project Same set of files for all assignments and laboratory Use the automated features of the GUI to “convert” VDSP project to test project 11/24/2018 Concept of Test Driven Development applied to Embedded Systems M. Smith University of Calgary, Canada

Now add your Assignment1 subroutines files to the Assignment1Test project Don’t move or copy the files into the test directory – just “add” them to the project Note the use of “Assignment1.h” which has the prototypes for all “C++” and “assembly code” functions used (from Assignment dir.) This files are “added” to the “Test” project and NOT copied from the Assignment1 directory 11/24/2018 Concept of Test Driven Development applied to Embedded Systems M. Smith University of Calgary, Canada

The GUI has automatically added the “Tests_main.cpp” 11/24/2018 Concept of Test Driven Development applied to Embedded Systems M. Smith University of Calgary, Canada

The GUI has automatically added a “TestGroup” file for you 11/24/2018 Concept of Test Driven Development applied to Embedded Systems M. Smith University of Calgary, Canada

Modify “Assignment1Tests.cpp” to perform the needed testing 11/24/2018 Concept of Test Driven Development applied to Embedded Systems M. Smith University of Calgary, Canada

Tests and Test Groups have a standard format TESTGROUP NAME TEST NAME Add further tests at this location TESTGROUP NAME, 11/24/2018 Concept of Test Driven Development applied to Embedded Systems M. Smith University of Calgary, Canada

Tests then need to be customized A lot of this can be automated by GUI 11/24/2018 Concept of Test Driven Development applied to Embedded Systems M. Smith University of Calgary, Canada

Test Components Remember format for “exams” and “quizzes” The ACTUAL Test (This is a TEST MACRO) CHECK(result1 == result2) Would provided better test messages if we “self-documented the code” int result1_CPP = int result2_ASM = CHECK(result_CPP == result_ASM); Test CONTROL statements (ALL MACROS) TEST_CONTROL( testgroup_name) TEST_FILE_RUN_NOTIFICATION( testgroup_name) 11/24/2018 Concept of Test Driven Development applied to Embedded Systems M. Smith University of Calgary, Canada

Have added stub versions of functions Note “code DEFECT” There is NO return value placed in R0 11/24/2018 Concept of Test Driven Development applied to Embedded Systems M. Smith University of Calgary, Canada

Now build source files to make executable 11/24/2018 Concept of Test Driven Development applied to Embedded Systems M. Smith University of Calgary, Canada Note the format of the error messages.

Fix the code. Review the code for syntax errors and “logical” errors DON’T IGNORE WARNINGS 11/24/2018 Concept of Test Driven Development applied to Embedded Systems M. Smith University of Calgary, Canada

Now “build and run” the tests All the tests should fail (no code) Quick test failure visualization Detailed test failure information 11/24/2018 Concept of Test Driven Development applied to Embedded Systems M. Smith University of Calgary, Canada

Now “build and run” the tests All the tests should fail (no code) Quick test failure visualization Clicking on the “detailed test info” automatically takes you to the “test” that failed Detailed test failure information 11/24/2018 Concept of Test Driven Development applied to Embedded Systems M. Smith University of Calgary, Canada

The test that failed Clicking on the “detailed test info” automatically takes you to the “test” that failed 11/24/2018 Concept of Test Driven Development applied to Embedded Systems M. Smith University of Calgary, Canada

Test information modes are controlled in “Test_main” Show Failures and Expected Failures only Show Failures and Successes 11/24/2018 Concept of Test Driven Development applied to Embedded Systems M. Smith University of Calgary, Canada

Add further tests at this location Add a separate test to show that result2 (from the ASM code) is equal to 42 Add further tests at this location 11/24/2018 Concept of Test Driven Development applied to Embedded Systems M. Smith University of Calgary, Canada

Gui automatically adds new test 11/24/2018 Concept of Test Driven Development applied to Embedded Systems M. Smith University of Calgary, Canada

Write the tests for “self-documenting” messages (What does “result1 == result2” mean if 200 tests present?) HAVE WANT 11/24/2018 Concept of Test Driven Development applied to Embedded Systems M. Smith University of Calgary, Canada

Write the “CPP” code to get to work but “Write the ASM for speed” “../E-UNITIncludes/E-UNIT_Tests1Sept07.h” FAIL SUCCESS SUCCESS 11/24/2018 Concept of Test Driven Development applied to Embedded Systems M. Smith University of Calgary, Canada

Get a “Volun-tell” to come to the front and write the “better” test 11/24/2018 Concept of Test Driven Development applied to Embedded Systems M. Smith University of Calgary, Canada

Available ASSERTS More can be “customized” CHECK(expected == actual) – Success if passes XF_CHECK(expected == actual) – Success if “fails” CHECK_EQUAL(expected, actual) XF_CHECK_EQUAL(expected, actual) – Success if fails CHECK_CLOSE(expected, actual, tolerance) CHECK_ARRAY_EQUAL(expected, actual, length) CHECK_ARRAY_CLOSE(expected, actual, length, toler) REPORT(“character message”); 11/24/2018 Concept of Test Driven Development applied to Embedded Systems M. Smith University of Calgary, Canada

Handled today – some easy “non-programming” quiz and midterm questions Why test, and what kinds of tests are there? Difference between TLD – Test Last Development TDD – Test Driven Development (Test First Development) How do you add tests for Assignment 1? More details on the testing process E-TDD and the testing tool E-UNIT Other kinds of available tests – time and access Design of custom TESTs and ASSERTS 11/24/2018 Concept of Test Driven Development applied to Embedded Systems M. Smith University of Calgary, Canada