KEMBAR78
Automated hardware testing using python | PPT
AUTOMATED HARDWARE TESTINGAUTOMATED HARDWARE TESTING
USING PYTHONUSING PYTHON
1
Name : YUVARAJA RAVI
Reg No : 13PEES1005
course : M.TECH EMBEDDED
2
NAME : YUVARAJA.R
REGISTER NUMBER : 13PEES1005
LANGUAGE : EMBEDDED C & PYTHON
PROJECT INCHARGE : K.Bhaskar B.Tech., M.E.(Ph.D)
ABSTRACTABSTRACT
Design a Embedded Prototype test hardware
interact with Python software shows presence
of defects in UUT. Python test script can
download the test cases to the target system
one by one, receive test output, compare with
specifications then verify it, and generate log
files. Log files inside test steps results are
stored as PASS/FAIL.
It’s a cost effective test system for SS
Electronic hardware manufacturers
3
TESTINGTESTING
Testing is an organized process to verify
the behavior, performance, and reliability
of a device
It ensures a device or system to be as
defect-free as possible
Testing is a manufacturing step to ensure
that the manufactured device is defect
free
4
HARDWARE TESTINGHARDWARE TESTING
  A common test platform (CTP), also called an open test
standard (OTS), is a set of specifications defining test methods
for diverse components of computer and electronic systems
to be marketed as complete products. The intent of a CTP is
to ensure consistency in hardware and software test
procedures from the conceptual and design phases through
manufacture and distribution.
 Computers, computer peripherals and electronic systems
often contain complex devices, circuits, programs and
interfaces. These must all work together in a variety of
applications and conditions. A CTP can be part of an overall
quality assurance program. A common standard can reduce
the cost of test equipment, optimize the use of available test
equipment, increase production efficiency and minimize
training costs.
5
EXISTING SYSTEMEXISTING SYSTEM
 Testing is carried out manually by test engineers.
Consuming a lot of time and effort huge for spending
the time for testing.
 NI Lab View designing a ATE .But measurements are
taken by reputed instruments or NI PXI only
 PXI HW and its software is huge amount.
 Certified engineer only able to access the software
 Add-on software needed for Test case and Report
generation .
6
PROPOSED SYSTEMPROPOSED SYSTEM
 To overcome the existing problem, we construct Embedded
hardware test module to measure the
 Resistance test applied to signal traces (short/open)
 Voltage /current measure with help of analog pins.
 IO pins used to trigger the on/off or control the hw.
 Protocols testing are done by the test hardware.
 Tested data packets serially communicated to the Python scritps
 Python scripts collect the complied data's then compare with test
case input and generate the test reports..
7
PROJECT – ENTIRE SYSTEMPROJECT – ENTIRE SYSTEM
8
SERIAL INTERFACE
EMBEDDED TEST HW DESIGNEMBEDDED TEST HW DESIGN
 Atmega 8-bit AVR controller used for Embedded Test
Hardware system.
 Necessity to test the every protocols chips, Analog and
Digital IC.
 Current, Voltage and Resistance measurements using 10bit
ADC
 I2C >> | TEMP | EEPROM | SENSORS | DEVICES |
 UART >> RS232 <<
 RS485 >> 75176-IC <<
 RS422 >> 75176-IC <<
9
HW DESIGN – VOLTAGE ,CURRENT &HW DESIGN – VOLTAGE ,CURRENT &
RESISTANCE MEASUREMENTRESISTANCE MEASUREMENT
Voltage measured by using AVR
Controller 10bit ADC
Current measurement taken by ACS712
Current sensor IC.
Constant current probing to the voltage
net through voltage divider circuit.
Impedance measured by the ADC.
10
HW DESIGN – PROTOCOLS TESTING-I2CHW DESIGN – PROTOCOLS TESTING-I2C
 I2C (Inter-Integrated Circuit, pronounced "I squared
C") is also a synchronous protocol.I2C uses only 2
wires, one for the clock (SCL) and one for the data
(SDA). That means that master and slave send data
over the same wire, again controlled by the master.
11
HW DESIGN – PROTOCOLSHW DESIGN – PROTOCOLS
TESTING-UART / SERIALTESTING-UART / SERIAL
  Serial communication is the process of sending data
one bit one by one sequentially, over a
communication channel.
 UART communication of Full duplex TX and RX
communication through the COM devices.
12
HW DESIGN – PROTOCOLSHW DESIGN – PROTOCOLS
TESTING – RS485TESTING – RS485
 RS-485 allows multiple devices (up to 32) to
communicate at half-duplex on a single pair of
wires, plus a ground wire (more on that later),
at distances up to 1200 meters (4000 feet)
 RS485 Differential communication through A <-
> B Signal lines.
13
HW DESIGN – PROTOCOLSHW DESIGN – PROTOCOLS
TESTING – RS422TESTING – RS422
 Serial, balanced and differential are the keywords for the RS422
interface standard. Serial means, that the information is sent bit by
bit on a single transmission line, just like with RS232. Balanced
differential is what makes RS422 different from RS232
14
SW Design - PYTHONSW Design - PYTHON
Python is a clear and powerful object-
oriented programming language,
comparable to Perl, Tcl and Java.
It’s a FOSS Programming language.
Runs on many different computers and
operating systems: Windows, MacOS,
many brands of Unix, OS/2
Python Code can be grouped into
modules and packages
15
SOFTWARE DESIGN - PYTHONSOFTWARE DESIGN - PYTHON
An open source software used to Automate
the Hardware Testing
UNITTEST module supports test automation,
sharing of setup and shutdown code for tests,
aggregation of tests into collections, and
independence of the tests from the reporting
framework.
AUTOMATED HARDWARE TESTING 16
UNIT TEST MODULE CONCEPTSUNIT TEST MODULE CONCEPTS
 Test Fixture : It represents the preparation needed to perform one
or more tests, and any associate cleanup actions. This may involve,
for example, creating temporary or proxy databases, directories, or
starting a server process.
 Test Case: is the smallest unit of testing. It checks for a specific
response to a particular set of inputs. Unit test provides a base
class, Test Case which may be used to create new test cases.
 Test Suite: Test suite is a collection of test cases, test suites, or
both. It is used to aggregate tests that should be executed together.
 Test Plan: Test plan is a document detailing the objectives, target
market, internal beta team, and processes for a specific beta test for
a software or hardware product. The plan typically contains a
detailed understanding of the eventual workflow.
AUTOMATED HARDWARE TESTING 17
SW –Development FlowSW –Development Flow
AUTOMATED HARDWARE TESTING 18
Requirements & Test CaseRequirements & Test Case
RelationshipRelationship
AUTOMATED HARDWARE TESTING 19
UUT Code SampleUUT Code Sample
Def ScaledInput(data):
rc = NO_ERR
scaled_data = data
if data >= DATA_MIN and data <= DATA_MAX:
scaled_data = (data * data_scale) + data_offset
if scaled_data > SCALE_MAX:
scaled_data = SCALE_MAX
rc = ERR_MAXSCALE
elif scaled_data < SCALE_MIN:
scaled_data = SCALE_MIN
rc = ERR_MINSCALE
else:
rc = ERR_OVER
return (rc, scaled_data)
AUTOMATED HARDWARE TESTING 20
Function code getting one input argument
Function Returning two o/p values
Function with argument code tableFunction with argument code table
AUTOMATED HARDWARE TESTING 21
A unit test is constructed such that all possible
inputs are used to force the execution to traverse
all possible paths. In the case of ScaledInput(), we
can see that there are three obvious input test
cases. Too low,
Too high,
Within range.
Test Case Function Flow chartTest Case Function Flow chart
AUTOMATED HARDWARE TESTING 22
Test Step Flow ChartTest Step Flow Chart
AUTOMATED HARDWARE TESTING 23
PYTHON SCRIPTPYTHON SCRIPT
TEST CASETEST CASE
Each automatic test case
contains assigned Python
script that is executed by
Executor application. Figure
presents general flow chart
for writing automatic scripts for
functional testing.
24
PYTHON TEST RESULTPYTHON TEST RESULT
25
ADVANTAGESADVANTAGES
Boards, components and interface cable
separately tested in modes of test case.
Manual testing has been reduced
Locating the Hardware(components) and
software bugs using test reports.
Low Cost (Pursuing software’s are Open
source)
Reduced human efforts
26
DISADVANTAGESDISADVANTAGES
Embedded controllers are single task at a
instant. So measuring data goes to the pc
with delay. Output data packets compared
with test case help of Python Script. So
report generating time taken more.
27
CONCLUSIONCONCLUSION
 Automatic hardware testing using Python is a ATE
technique to increase throughput without a
corresponding increase in cost, by performing tests on
protocols are handling and test without error. It has
been shown quantitatively to reduce test cost more
effectively than low-cost ATE. Because it reduces all
test cost contributors, and not only capital cost of ATE.
 In this paper, we described the AHT using python
strategy adopted for hardware testing and protocols
testing without measuring instruments .
28
FUTURE ENHANCEMENTFUTURE ENHANCEMENT
In this project in future we can add a
FPGA or CPLD used to get the data
packets at instant of time without delay.
Parallel Testing method introduces to
test the multiple boards at same instant
time.
29
BASE PAPERSBASE PAPERS
 [1] Jambunatha, K .,Design and implement Automated Procedure to upgrade
remote network devices using Python, Advance Computing Conference (IACC),
2015 IEEE International, Bangalore, June 2015.
 [2] Karmore, S.P.; Mabajan, A.R., Universal methodology for embedded system
testing., Computer Science & Education (ICCSE), 2013 8th International Conference
on Year: 2013,IEEE Conference Publications, 26-28 April 2013
 [3] Kovacevic, M.; Kovacevic, B.; Pekovic, V.; Stefanovic, D., Framework for
automatic testing of Set-top boxes., Telecommunications Forum Telfor (TELFOR),
22ndYear: 2014
 [4] Kim H. Pries, Jon M. Quigley-Testing Complex and Embedded Systems-CRC
Press (2010)
 [5] Python Programming Language, URL http://python.org/.
30
THANK YOUTHANK YOU
31

Automated hardware testing using python

  • 1.
    AUTOMATED HARDWARE TESTINGAUTOMATEDHARDWARE TESTING USING PYTHONUSING PYTHON 1 Name : YUVARAJA RAVI Reg No : 13PEES1005 course : M.TECH EMBEDDED
  • 2.
    2 NAME : YUVARAJA.R REGISTERNUMBER : 13PEES1005 LANGUAGE : EMBEDDED C & PYTHON PROJECT INCHARGE : K.Bhaskar B.Tech., M.E.(Ph.D)
  • 3.
    ABSTRACTABSTRACT Design a EmbeddedPrototype test hardware interact with Python software shows presence of defects in UUT. Python test script can download the test cases to the target system one by one, receive test output, compare with specifications then verify it, and generate log files. Log files inside test steps results are stored as PASS/FAIL. It’s a cost effective test system for SS Electronic hardware manufacturers 3
  • 4.
    TESTINGTESTING Testing is anorganized process to verify the behavior, performance, and reliability of a device It ensures a device or system to be as defect-free as possible Testing is a manufacturing step to ensure that the manufactured device is defect free 4
  • 5.
    HARDWARE TESTINGHARDWARE TESTING  A common test platform (CTP), also called an open test standard (OTS), is a set of specifications defining test methods for diverse components of computer and electronic systems to be marketed as complete products. The intent of a CTP is to ensure consistency in hardware and software test procedures from the conceptual and design phases through manufacture and distribution.  Computers, computer peripherals and electronic systems often contain complex devices, circuits, programs and interfaces. These must all work together in a variety of applications and conditions. A CTP can be part of an overall quality assurance program. A common standard can reduce the cost of test equipment, optimize the use of available test equipment, increase production efficiency and minimize training costs. 5
  • 6.
    EXISTING SYSTEMEXISTING SYSTEM Testing is carried out manually by test engineers. Consuming a lot of time and effort huge for spending the time for testing.  NI Lab View designing a ATE .But measurements are taken by reputed instruments or NI PXI only  PXI HW and its software is huge amount.  Certified engineer only able to access the software  Add-on software needed for Test case and Report generation . 6
  • 7.
    PROPOSED SYSTEMPROPOSED SYSTEM To overcome the existing problem, we construct Embedded hardware test module to measure the  Resistance test applied to signal traces (short/open)  Voltage /current measure with help of analog pins.  IO pins used to trigger the on/off or control the hw.  Protocols testing are done by the test hardware.  Tested data packets serially communicated to the Python scritps  Python scripts collect the complied data's then compare with test case input and generate the test reports.. 7
  • 8.
    PROJECT – ENTIRESYSTEMPROJECT – ENTIRE SYSTEM 8 SERIAL INTERFACE
  • 9.
    EMBEDDED TEST HWDESIGNEMBEDDED TEST HW DESIGN  Atmega 8-bit AVR controller used for Embedded Test Hardware system.  Necessity to test the every protocols chips, Analog and Digital IC.  Current, Voltage and Resistance measurements using 10bit ADC  I2C >> | TEMP | EEPROM | SENSORS | DEVICES |  UART >> RS232 <<  RS485 >> 75176-IC <<  RS422 >> 75176-IC << 9
  • 10.
    HW DESIGN –VOLTAGE ,CURRENT &HW DESIGN – VOLTAGE ,CURRENT & RESISTANCE MEASUREMENTRESISTANCE MEASUREMENT Voltage measured by using AVR Controller 10bit ADC Current measurement taken by ACS712 Current sensor IC. Constant current probing to the voltage net through voltage divider circuit. Impedance measured by the ADC. 10
  • 11.
    HW DESIGN –PROTOCOLS TESTING-I2CHW DESIGN – PROTOCOLS TESTING-I2C  I2C (Inter-Integrated Circuit, pronounced "I squared C") is also a synchronous protocol.I2C uses only 2 wires, one for the clock (SCL) and one for the data (SDA). That means that master and slave send data over the same wire, again controlled by the master. 11
  • 12.
    HW DESIGN –PROTOCOLSHW DESIGN – PROTOCOLS TESTING-UART / SERIALTESTING-UART / SERIAL   Serial communication is the process of sending data one bit one by one sequentially, over a communication channel.  UART communication of Full duplex TX and RX communication through the COM devices. 12
  • 13.
    HW DESIGN –PROTOCOLSHW DESIGN – PROTOCOLS TESTING – RS485TESTING – RS485  RS-485 allows multiple devices (up to 32) to communicate at half-duplex on a single pair of wires, plus a ground wire (more on that later), at distances up to 1200 meters (4000 feet)  RS485 Differential communication through A <- > B Signal lines. 13
  • 14.
    HW DESIGN –PROTOCOLSHW DESIGN – PROTOCOLS TESTING – RS422TESTING – RS422  Serial, balanced and differential are the keywords for the RS422 interface standard. Serial means, that the information is sent bit by bit on a single transmission line, just like with RS232. Balanced differential is what makes RS422 different from RS232 14
  • 15.
    SW Design -PYTHONSW Design - PYTHON Python is a clear and powerful object- oriented programming language, comparable to Perl, Tcl and Java. It’s a FOSS Programming language. Runs on many different computers and operating systems: Windows, MacOS, many brands of Unix, OS/2 Python Code can be grouped into modules and packages 15
  • 16.
    SOFTWARE DESIGN -PYTHONSOFTWARE DESIGN - PYTHON An open source software used to Automate the Hardware Testing UNITTEST module supports test automation, sharing of setup and shutdown code for tests, aggregation of tests into collections, and independence of the tests from the reporting framework. AUTOMATED HARDWARE TESTING 16
  • 17.
    UNIT TEST MODULECONCEPTSUNIT TEST MODULE CONCEPTS  Test Fixture : It represents the preparation needed to perform one or more tests, and any associate cleanup actions. This may involve, for example, creating temporary or proxy databases, directories, or starting a server process.  Test Case: is the smallest unit of testing. It checks for a specific response to a particular set of inputs. Unit test provides a base class, Test Case which may be used to create new test cases.  Test Suite: Test suite is a collection of test cases, test suites, or both. It is used to aggregate tests that should be executed together.  Test Plan: Test plan is a document detailing the objectives, target market, internal beta team, and processes for a specific beta test for a software or hardware product. The plan typically contains a detailed understanding of the eventual workflow. AUTOMATED HARDWARE TESTING 17
  • 18.
    SW –Development FlowSW–Development Flow AUTOMATED HARDWARE TESTING 18
  • 19.
    Requirements & TestCaseRequirements & Test Case RelationshipRelationship AUTOMATED HARDWARE TESTING 19
  • 20.
    UUT Code SampleUUTCode Sample Def ScaledInput(data): rc = NO_ERR scaled_data = data if data >= DATA_MIN and data <= DATA_MAX: scaled_data = (data * data_scale) + data_offset if scaled_data > SCALE_MAX: scaled_data = SCALE_MAX rc = ERR_MAXSCALE elif scaled_data < SCALE_MIN: scaled_data = SCALE_MIN rc = ERR_MINSCALE else: rc = ERR_OVER return (rc, scaled_data) AUTOMATED HARDWARE TESTING 20 Function code getting one input argument Function Returning two o/p values
  • 21.
    Function with argumentcode tableFunction with argument code table AUTOMATED HARDWARE TESTING 21 A unit test is constructed such that all possible inputs are used to force the execution to traverse all possible paths. In the case of ScaledInput(), we can see that there are three obvious input test cases. Too low, Too high, Within range.
  • 22.
    Test Case FunctionFlow chartTest Case Function Flow chart AUTOMATED HARDWARE TESTING 22
  • 23.
    Test Step FlowChartTest Step Flow Chart AUTOMATED HARDWARE TESTING 23
  • 24.
    PYTHON SCRIPTPYTHON SCRIPT TESTCASETEST CASE Each automatic test case contains assigned Python script that is executed by Executor application. Figure presents general flow chart for writing automatic scripts for functional testing. 24
  • 25.
  • 26.
    ADVANTAGESADVANTAGES Boards, components andinterface cable separately tested in modes of test case. Manual testing has been reduced Locating the Hardware(components) and software bugs using test reports. Low Cost (Pursuing software’s are Open source) Reduced human efforts 26
  • 27.
    DISADVANTAGESDISADVANTAGES Embedded controllers aresingle task at a instant. So measuring data goes to the pc with delay. Output data packets compared with test case help of Python Script. So report generating time taken more. 27
  • 28.
    CONCLUSIONCONCLUSION  Automatic hardwaretesting using Python is a ATE technique to increase throughput without a corresponding increase in cost, by performing tests on protocols are handling and test without error. It has been shown quantitatively to reduce test cost more effectively than low-cost ATE. Because it reduces all test cost contributors, and not only capital cost of ATE.  In this paper, we described the AHT using python strategy adopted for hardware testing and protocols testing without measuring instruments . 28
  • 29.
    FUTURE ENHANCEMENTFUTURE ENHANCEMENT Inthis project in future we can add a FPGA or CPLD used to get the data packets at instant of time without delay. Parallel Testing method introduces to test the multiple boards at same instant time. 29
  • 30.
    BASE PAPERSBASE PAPERS [1] Jambunatha, K .,Design and implement Automated Procedure to upgrade remote network devices using Python, Advance Computing Conference (IACC), 2015 IEEE International, Bangalore, June 2015.  [2] Karmore, S.P.; Mabajan, A.R., Universal methodology for embedded system testing., Computer Science & Education (ICCSE), 2013 8th International Conference on Year: 2013,IEEE Conference Publications, 26-28 April 2013  [3] Kovacevic, M.; Kovacevic, B.; Pekovic, V.; Stefanovic, D., Framework for automatic testing of Set-top boxes., Telecommunications Forum Telfor (TELFOR), 22ndYear: 2014  [4] Kim H. Pries, Jon M. Quigley-Testing Complex and Embedded Systems-CRC Press (2010)  [5] Python Programming Language, URL http://python.org/. 30
  • 31.