Unit tests, Integration tests Physics tests Andrea Dotti, Gunter Folger, Pere Mato CERN – PH/SFT Geant4 workshop 2012.

Slides:



Advertisements
Similar presentations
Introduction to Maven 2.0 An open source build tool for Enterprise Java projects Mahen Goonewardene.
Advertisements

National Alliance for Medical Image Computing Testing with CTest and CDash Julien Jomier Kitware Inc.
Test Case Management and Results Tracking System October 2008 D E L I V E R I N G Q U A L I T Y (Short Version)
P. Mato/CERN.  Work done in the context of Geant4 ◦ Presented at last Collaboration meeting  Facilitate testing and packaging using the tools (CTest.
D. Düllmann - IT/DB LCG - POOL Project1 POOL Release Plan for 2003 Dirk Düllmann LCG Application Area Meeting, 5 th March 2003.
St Testing, Simulation and Monitoring (actually mostly simulation) Stephen Hillier Joint Meeting, Mainz, June 2001.
Testing - an Overview September 10, What is it, Why do it? Testing is a set of activities aimed at validating that an attribute or capability.
Automated Tests in NICOS Nightly Control System Alexander Undrus Brookhaven National Laboratory, Upton, NY Software testing is a difficult, time-consuming.
Introduction to The Linaro Toolchain Embedded Processors Training Multicore Software Applications Literature Number: SPRPXXX 1.
1 Introduction to Tool chains. 2 Tool chain for the Sitara Family (but it is true for other ARM based devices as well) A tool chain is a collection of.
Quality Assurance and Testing in LCG CHEP 2004 Interlaken, Switzerland 30 September 2004 Manuel Gallas, Jakub MOSCICKI CERN
Renesas Technology America Inc. 1 M16C/Tiny SKP Tutorial 2 Creating A New Project Using HEW4.
Unit Testing & Defensive Programming. F-22 Raptor Fighter.
M. Gallas IT-API LCG SPI project: testing1 Software Testing Infrastructure status LCG Software Process & Infrastructure (CERN, 10/23/02)
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
I. Pribela, M. Ivanović Neum, Content Automated assessment Testovid system Test generator Module generators Conclusion.
M Gallas CERN EP-SFT LCG-SPI: SW-Testing1 LCG-SPI: SW-Testing LCG Applications Area GridPP 7 th Collaboration Meeting LCG/SPI LCG.
What is Sure BDCs? BDC stands for Batch Data Communication and is also known as Batch Input. It is a technique for mass input of data into SAP by simulating.
Introduction to Hall-D Software February 27, 2009 David Lawrence - JLab.
© 2012 LogiGear Corporation. All Rights Reserved Robot framework.
Rsv-control Marco Mambelli – Site Coordination meeting October 1, 2009.
The Pipeline Processing Framework LSST Applications Meeting IPAC Feb. 19, 2008 Raymond Plante National Center for Supercomputing Applications.
Copyright © 2007, Oracle. All rights reserved. Managing Concurrent Requests.
INFSOM-RI Juelich, 10 June 2008 ETICS - Maven From competition, to collaboration.
SRM 2.2: status of the implementations and GSSD 6 th March 2007 Flavia Donno, Maarten Litmaath INFN and IT/GD, CERN.
Summary of Functions Coordinator of the physics lists working group in Geant4 and contributor to physics lists. (20%) Developer of Geant4 hadronic physics,
LCG Middleware Testing in 2005 and Future Plans E.Slabospitskaya, IHEP, Russia CERN-Russia Joint Working Group on LHC Computing March, 6, 2006.
Progress with migration to SVN Part3: How to work with g4svn and geant4tags tools. Geant4.
Study for Migration from CVS to SubVersion (SVN) Gunter Folger CERN/PH/SFT.
1 / 22 AliRoot and AliEn Build Integration and Testing System.
Software Construction Lecture 18 Software Testing.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Memory: Relocation.
LCG-SPI: SW-Testing LCG AppArea internal review (20/10/03)
Apache JMeter By Lamiya Qasim. Apache JMeter Tool for load test functional behavior and measure performance. Questions: Does JMeter offers support for.
EGEE-III INFSO-RI Enabling Grids for E-sciencE EGEE and gLite are registered trademarks Stephen Childs Trinity College Dublin &
David Adams ATLAS DIAL/ADA JDL and catalogs David Adams BNL December 4, 2003 ATLAS software workshop Production session CERN.
Andrei Gheata, Mihaela Gheata, Andreas Morsch ALICE offline week, 5-9 July 2010.
CHEP 2013, Amsterdam Reading ROOT files in a browser ROOT I/O IN JAVASCRIPT B. Bellenot, CERN, PH-SFT B. Linev, GSI, CS-EE.
M Gallas CERN EP-SFT LCG-SPI: SW-Testing1 LCG-SPI: SW-Testing QMTest test framework LCG AppArea meeting (16/07/03) LCG/SPI LCG Software.
Test Specifications A Specification System for Multi-Platform Test Suite Configuration, Build, and Execution Greg Cooksey.
Renesas Technology America Inc. 1 M16C Seminars Lab 3 Creating Projects Using HEW4 14 March 2005 M16C Seminars Lab 3 Creating Projects Using HEW4 Last.
B. Hegner, P. Mato, P. Mendez CERN, PH-SFT Group 1 ST FORUM CERN 28-SEP-2015 THE QUALITY AND TESTING INFRASTRUCTURE OF PH-SFT.
EMI is partially funded by the European Commission under Grant Agreement RI SA2 – Development Tools Andres Abad Rodriguez SA2.4 Tools Activity Leader.
Renesas Technology America Inc. 1 SKP8CMINI Tutorial 2 Creating A New Project Using HEW.
G.Govi CERN/IT-DB 1 September 26, 2003 POOL Integration, Testing and Release Procedure Integration  Packages structure  External dependencies  Configuration.
Yannick Patois - Datagrid Software Repository Presentation - March, n° 1 Datagrid Software Repository Presentation CVS, packages and automatic.
© 2008 Wipro Ltd - Confidential Informatica & ETL Testing Rahul Parashar.
Geant4 is a toolkit to simulate the passage of particles through matter, and is widely used in HEP, in medical physics and for space applications. Ongoing.
October Test Beam DAQ. Framework sketch Only DAQs subprograms works during spills Each subprogram produces an output each spill Each dependant subprogram.
Pavel Nevski DDM Workshop BNL, September 27, 2006 JOB DEFINITION as a part of Production.
Build Tools 1. Building a program for a large project is usually managed by a build tool that controls the various steps involved. These steps may include:
Feedback from CMS Andrew Lahiff STFC Rutherford Appleton Laboratory Contributions from Christoph Wissing, Bockjoo Kim, Alessandro Degano CernVM Users Workshop.
Software testing techniques Software testing techniques REGRESSION TESTING Presentation on the seminar Kaunas University of Technology.
20 October 2005 LCG Generator Services monthly meeting, CERN Validation of GENSER & News on GENSER Alexander Toropin LCG Generator Services monthly meeting.
JRA1 Meeting – 09/02/ Software Configuration Management and Integration EGEE is proposed as a project funded by the European Union under contract.
1 PSI/PhUSE Single Day Event – SAS Applications – June 11, 2009 SAS Drug Development from the Inside Magnus Mengelbier Director.
Modularization of Geant4 Dynamic loading of modules Configurable build using CMake Pere Mato Witek Pokorski
Geant4 Collaboration Meeting 2011, SLAC P. Mato/CERN.
ANALYSIS TRAIN ON THE GRID Mihaela Gheata. AOD production train ◦ AOD production will be organized in a ‘train’ of tasks ◦ To maximize efficiency of full.
SYSTEM INTEGRATION TESTING Getting ready for testing shifts Gunter Folger CERN PH/SFT Geant4 Collaboration Workshop 2011 SLAC.
CMake: Experience in ALICE P. Hristov 19/06/12. History I Recursive makefiles (F.Carminati): – Problems in dependencies – Slow "Recursive Makefiles.
Build and Test system for FairRoot
How to Contribute to System Testing and Extract Results
Generator Services planning meeting
Testing for patch certification
Releases and developments
Software Testing With Testopia
Instructor: Prasun Dewan (FB 150,
Gunter Folger Geant4 Genova Workshop 4-July-2001
Carthage ios 8 onwards Dependency manager that streamlines the process of integrating the libraries into the project.
Presentation transcript:

Unit tests, Integration tests Physics tests Andrea Dotti, Gunter Folger, Pere Mato CERN – PH/SFT Geant4 workshop 2012

Overview Unit tests o What we offer o What we expect from developers Integration tests o What and how the «nightlies» do for integration testing o How developers can better contribute o How developers can improve tests Physics tests o A new approach 10-Sep-2012Gunter Folger - CERN PH/SFT2

Unit tests Slides by Pere Mato CERN – PH/SFT 10-Sep-2012Gunter Folger - CERN PH/SFT3

4Introduction ✤ Unit Tests in source code tree are the only missing parts to be converted to CMake ✤ After this developers have no reason to not migrate to CMake ✤ Driving Goals/Requirements ✤ Easy of use - minimal effort developers ✤ Locality - adding new tests for a package requires to add/modify a single file in the package itself ✤ Minimal overhead if not interested on the tests ✤ Runnable eventually as part of the nightly/continuous integration tests 10-Sep-2012 Gunter Folger - CERN PH/SFT

5 Modus Operandi ✤ A Unit Test is either a single.cc file or a directory with a fix structure (single.cc and /src, /include directories) in a /test directory ✤ It would be nice if the tests do not require extra arguments and returns success if execution is successful ✤ Frameworks like CppUnit or similar could be used to write them ✤ Developer places a single CMakeLists.txt file in the /test directory ✤ Developer configures with cmake - DGEANT4_BUILD_TESTS=ON ✤ Developer builds the tests with make testXXX or make testXXX/fast or make tests to build all of them ✤ Developer runs each test with output/runtime/testXXX or all of them using CTest with ctest -L UnitTests 10-Sep-2012Gunter Folger - CERN PH/SFT

6.../test/CMakeLists.txt GEANT4_ADD_UNIT_TESTS(testMatC*.cc testA*.cc testE*.cc testG*.cc INCLUDE_DIRS geometry/management/include global/management/include global/HEPRandom/include global/HEPNumerics/include global/HEPGeometry/include materials/include intercoms/include ${CLHEP_INCLUDE_DIRS} LIBRARIES G4geometry) GEANT4_ADD_UNIT_TESTS(testMatC*.cc testA*.cc testE*.cc testG*.cc INCLUDE_DIRS geometry/management/include global/management/include global/HEPRandom/include global/HEPNumerics/include global/HEPGeometry/include materials/include intercoms/include ${CLHEP_INCLUDE_DIRS} LIBRARIES G4geometry) default is test*.cc directories are also possible dependent libraries added automatically unfortunately dependent include directories are needed explicitly 10-Sep-2012Gunter Folger - CERN PH/SFT

7 Build-Run session [.../G4/build]% cmake -DGEANT4_BUILD_TESTS=ON [-DGEANT4_ENABLE_TESTING=ON]. -- The following Geant4 features are enabled: GEANT4_BUILD_TESTS: Build all the tests of the project GEANT4_ENABLE_TESTING: Enable and define all the tests of the project GEANT4_USE_SYSTEM_EXPAT: Use system EXPAT library -- Configuring done -- Generating done -- Build files have been written to: /Users/mato/Development/G4/build [.../G4/build]% make testMatComponents [ 15%] Built target G4clhep [ 23%] Built target G4global [ 30%] Built target G4intercoms [ 38%] Built target G4materials [ 46%] Built target G4graphics_reps [100%] Built target G4geometry [100%] Building CXX object source/materials/test/CMakeFiles/testMatComponents.dir/testMatComponents.cc.o Linking CXX executable../../../outputs/runtime/testMatComponents [100%] Built target testMatComponents [.../G4/build]% outputs/runtime/testMatComponents ***** Table : Nb of materials = 4 ***** [.../G4/build]% ctest -L UnitTests Test project /Users/mato/Development/G4/build Start 1: testProElectroMagField 1/54 Test #1: testProElectroMagField Passed 1.57 sec Start 2: testPropagateMagField 2/54 Test #2: testPropagateMagField Passed 0.67 sec [.../G4/build]% cmake -DGEANT4_BUILD_TESTS=ON [-DGEANT4_ENABLE_TESTING=ON]. -- The following Geant4 features are enabled: GEANT4_BUILD_TESTS: Build all the tests of the project GEANT4_ENABLE_TESTING: Enable and define all the tests of the project GEANT4_USE_SYSTEM_EXPAT: Use system EXPAT library -- Configuring done -- Generating done -- Build files have been written to: /Users/mato/Development/G4/build [.../G4/build]% make testMatComponents [ 15%] Built target G4clhep [ 23%] Built target G4global [ 30%] Built target G4intercoms [ 38%] Built target G4materials [ 46%] Built target G4graphics_reps [100%] Built target G4geometry [100%] Building CXX object source/materials/test/CMakeFiles/testMatComponents.dir/testMatComponents.cc.o Linking CXX executable../../../outputs/runtime/testMatComponents [100%] Built target testMatComponents [.../G4/build]% outputs/runtime/testMatComponents ***** Table : Nb of materials = 4 ***** [.../G4/build]% ctest -L UnitTests Test project /Users/mato/Development/G4/build Start 1: testProElectroMagField 1/54 Test #1: testProElectroMagField Passed 1.57 sec Start 2: testPropagateMagField 2/54 Test #2: testPropagateMagField Passed 0.67 sec 10-Sep-2012Gunter Folger - CERN PH/SFT

8Summary ✤ Add CMakeLists.txt with the lists of tests (wildcards allowed) ✤ Enable some CMake options ✤ Build and Run as usual ✤ build from the binary directory ✤ input files may stay in source directory or copied to binary directory ✤ We should encourage developers to add more tests 10-Sep-2012Gunter Folger - CERN PH/SFT

Integration tests 10-Sep-2012Gunter Folger - CERN PH/SFT9

Regular integration testing 10-Sep Gunter Folger - CERN PH/SFT Developer propose Tags Tester selects Tags Tester accepts / rejects tags Testing in “nightlies” Tester analyse results Shown 19-Sep-2011, G4 SLAC

Regular integration testing 10-Sep Gunter Folger - CERN PH/SFT Developer propose Tags Tester selects or rejects Tags Tester accepts / rejects tags Testing in ‘nightlies’ Tester analyses results Restricted Testing in ‘continous’ mode Developer can reject Tags

What is tested … and how Testing migrated to CMake/CTest/Cdash o Ctest/Cdash offer testing in multiple build groups Continuous build group o geant4/tests, except few which are excluded Nightly build group o geant4/tests, except few which are excluded o Many geant4/examples o benchmarks/calorimeter/FullCMS for main physics lists o benchmarks/calorimeter/HadCalCMS with all physics lists o Full list of tests is available in cdash per platform Criteria for success/fail of test unchanged o Test runs to completion o stderr is empty o Currently no other check, up to developer to implement 10-Sep-2012Gunter Folger - CERN PH/SFT12

How to improve testing Make sure errors are reported on stderr! Test program should check for good/expected results o Check relevant quantities, or physics result. Regression testing - session 7a o Compare quantities to previous accepted values o Tool to statistically compare histograms recently developed o Example for this Implemented in PhysicsTests - test73 Plans to extend setup to include tools like valgrind o Checking for memory access errors o Checking for leaks 10-Sep-2012Gunter Folger - CERN PH/SFT13 developer STT

Physics Tests Andrea Dotti CERN – PH/SFT 10-Sep-2012Gunter Folger - CERN PH/SFT14

15 Physics Monitoring Specialized CDash group to collect automatic testing of physics results Not used by shifter to reject/accept tags Ideally all model developers should provide at least one of such tests Will also use complete applications and examples from G4 source If test or example produces ROOT output Automatic testing against reference can be performed If output changes w.r.t. defined reference test FAILS Uses package available at: svn+ssh://svn.cern.ch/reps/g4tests/trunk/verification/StatTest Could be extended to read in different format files Discussion at Session Parallel 7A

16 Modified CMakeLists.txt #Perform simulation test: this test produces a ROOT file called result.root GEANT4_ADD_TEST(mytest-run COMMAND ${CMAKE_CURRENT_BINARY_DIR}/mytest.... LABELS PhysicsChecks ENVIRONMENT ${GEANT4_TEST_ENVIRONMENT}) #Execute regression testing only if StatTest program is available find_package(StatTest QUIET) if(STATTEST_FOUND) STATTEST_ADD_TEST ( mytest-checkOutput G4TEST mytest-run CONFIG testconf.qa INPUT result.root REFERENCE referencefile.root IMG imagefile.pdf LABELS PhysicsChecks) endif() Regression Configuration see StatTest/example/testconf.qa Web page in preparation

17Example PDF file is created, can test histos or Ntuples few statistical tests available (χ 2, Anderson Darling, Kolmogorov Smirnov) Ntuple check Histograms checks

18Status Currently we are in development phase of the common tools: test73-* : example of a test that fails if a fit is not as expected. Does not use automatic testing, all contained in classic “G4 test” style (example on where to start from) SimplifiedCalorimeter-* : example of testing with an external application. Uses automatic regression testing against reference test30-* (not yet in SVN): example of a test that has been extended with the automatic regression testing Issues/todos: Where to put reference files ?We do not want to “pollute” G4 SVN repository How to update references in a simple way when we have a new Geant4 release? What should be the policy to change a reference? Once these are solved we will put the system in production mode See:

Summary Testing is expanding o Load distributed to shift workers o More contributors to infrastructure CTest/CDash setup offers more flexibility o Simple validation can be included, physics checks. Developers need to use new tools and possibilities o After submission of tag, check result o Improve test code to verify correctness of test results 10-Sep-2012Gunter Folger - CERN PH/SFT19