1 / 49

NA-MIC, 2008 June Workshop, IHK Akademie Westerham Engineering Methodology

NA-MIC, 2008 June Workshop, IHK Akademie Westerham Engineering Methodology. Sebastien BARRE, Ph.D. - Kitware, Inc. Outline. Software Process, Extreme Programming The components of the NA-MIC kit software engineering tools: CMake CPack CTest CDash KWStyle.

benson
Download Presentation

NA-MIC, 2008 June Workshop, IHK Akademie Westerham Engineering Methodology

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. NA-MIC, 2008 June Workshop, IHK Akademie WesterhamEngineering Methodology Sebastien BARRE, Ph.D. - Kitware, Inc.

  2. Outline • Software Process, Extreme Programming • The components of the NA-MIC kit software engineering tools: • CMake • CPack • CTest • CDash • KWStyle NA-MIC, 2008 June Workshop, IHK Akademie Westerham NA-MIC, 2008 June Workshop, IHK Akademie Westerham June 16-17, 2008 2

  3. NA-MIC, 2008 June Workshop, IHK Akademie WesterhamSoftware Process, Extreme Programming Sebastien BARRE, Ph.D. - Kitware, Inc.

  4. Challenges • Software is larger and more complex than ever • Complex software requires teams; multi-site, multi-disciplinary, multi-layered, academic and commercial • Complex software demands long-term maintenance • Testing is vital to insure quality • Documentation needs are greater • Managing change to the system is critical to capture bug fixes • Abundance of computer configurations (hard/software, OS) means addressing cross-platform issues NA-MIC, 2008 June Workshop, IHK Akademie Westerham NA-MIC, 2008 June Workshop, IHK Akademie Westerham June 16-17, 2008 4

  5. Our solution • A methodology developed over several years in support of large-scale open-source projects • A methodology based on the principles of agile-programming or extreme-programming (late 90´s) • Ultimate Goal: • A production software release every day NA-MIC, 2008 June Workshop, IHK Akademie Westerham NA-MIC, 2008 June Workshop, IHK Akademie Westerham June 16-17, 2008 5

  6. Extreme Programming The idea is that the standard development tasks: • requirements generation, • software design, • managing source code versions and updates, • configuring projects for specific platforms, • compilation and linking, • testing the code at run time, • verifying the validity of output, • documenting the code, • tracking and repairing bugs are performed continuously rather than in a waterfall fashion. NA-MIC, 2008 June Workshop, IHK Akademie Westerham

  7. Extreme Programming (cont.) NA-MIC, 2008 June Workshop, IHK Akademie Westerham

  8. Heart and Soul of the Process • Testing is the mantra • Every night • Every time changes are made • Every time new computing platforms are introduced • “If is isn’t tested, it doesn’t work” • The results are posted to a web page for everyone to monitor • All developers have the right and encouragement to repair errors • A feedback loop is created between the community and the automated processes that measure software quality NA-MIC, 2008 June Workshop, IHK Akademie Westerham

  9. Results posted on web(the dashboard) Heart and Soul of the Process (cont.) Source coderepository Testing client compilessource code, runs tests CVS/ SVN Developers review results Developers check-in code NA-MIC, 2008 June Workshop, IHK Akademie Westerham

  10. Extreme Programming (cont.) The community owns the code • Although the identity of the original author is kept, other developers are free to correct defects and enhance each other's code • In the end, all of the software should appear as though one author wrote it NA-MIC, 2008 June Workshop, IHK Akademie Westerham

  11. Extreme Programming (cont.) Release early, release often • Although developers are tempted to keep their code under wraps until it is perfect, the process encourages them to release their code as soon as it passes some minimum tests • The longer the code is visible to the community, the better integrated it will be NA-MIC, 2008 June Workshop, IHK Akademie Westerham

  12. Extreme Programming (cont.) Continuous integration • There is no scheduled porting to computer platforms • All new software builds on supported platforms every evening NA-MIC, 2008 June Workshop, IHK Akademie Westerham

  13. Extreme Programming (cont.) All developers agree to keep the software defect free • Although everyone is encouraged to submit their code early, the code must compile and pass tests nightly • A continuous build process sends e-mails to developers who check in code that does not compile • More effectively, the community enforces the commitment though peer pressure NA-MIC, 2008 June Workshop, IHK Akademie Westerham

  14. Software Process Tools • Communication and Documentation • Revision Control • Build Management • Testing • Release process NA-MIC, 2008 June Workshop, IHK Akademie Westerham

  15. Communication and Documentation • Mailing lists • Wiki • Online documentation (Doxygen) • Issue/Bug Tracker • IM, TCON, VCON NA-MIC, 2008 June Workshop, IHK Akademie Westerham

  16. Mailing Lists • Mailman list manager • http://www.gnu.org/software/mailman/ • Two lists per project • developer – discussion about implementation details • user – discussion by users about how to use it • Provides a searchable archive • Dynamic, quick exchange of information NA-MIC, 2008 June Workshop, IHK Akademie Westerham

  17. Wiki • Powerful collaborative websites or intranets • http://www.mediawiki.org/wiki/MediaWiki • Easy to setup • Easy to edit • Don´t forget to backup NA-MIC, 2008 June Workshop, IHK Akademie Westerham

  18. Doxygen • Literate programming concepts • combine source and documentation • http://www.stack.nl/~dimitri/doxygen/docblocks.html • Run every night • Simple markup for C++/C code /** * ... text ... */ /*! * ... text ... */ /*! \brief Brief description. * Brief description continued. * Detailed description starts here. */ NA-MIC, 2008 June Workshop, IHK Akademie Westerham

  19. Doxygen (cont.) From vtkActor.h: // Description: // This causes the actor to be rendered. It in turn will render the actor's // property, texture map and then mapper. If a property hasn't been // assigned, then the actor will create one automatically. Note that a side // effect of this method is that the pipeline will be updated. virtual void Render(vtkRenderer *, vtkMapper *) {} http://www.vtk.org/doc/nightly/html/classvtkActor.html NA-MIC, 2008 June Workshop, IHK Akademie Westerham

  20. Issue Tracker • Web based issue tracker is required to keep track of bugs and fixes • Tracker of choice: Mantis http://www.mantisbt.org/ • Requires periodic “triage” (usually before a major release) NA-MIC, 2008 June Workshop, IHK Akademie Westerham

  21. sample.html <html> <head> <title>Simple Example</title> </head> <body> Hello, World! </body> </html> sample.html <html> <body> Hello, World! </body> </html> Revision Control • Projects evolve over time • Who changed what? When? Why? • SCM tools like CVS or SVN maintain a central repository of source code in which developers retrieve, modify and commit files and changes to files. NA-MIC, 2008 June Workshop, IHK Akademie Westerham

  22. Revision Control (cont.) • Commit • Date/time of change • Log message describing change • Person making the change • Versions before and after change • Commits can conflict, but the repository will not lock • Commits can be referenced in bug trackers NA-MIC, 2008 June Workshop, IHK Akademie Westerham

  23. = Version/Revision/State = Commit (new state and pointer to old) = Series of Commits release-1_2 trunk release-1_0 Revision Control (cont.) • Traditionally, history is always a tree • Each development path is a branch NA-MIC, 2008 June Workshop, IHK Akademie Westerham

  24. Working Tree Repo Repo Repo Repo Repo Working Tree W.T. W.T. W.T. W.T. W.T. Repository Repository Working Tree Working Tree Working Tree Revision Control (cont.) = flow of changes NA-MIC, 2008 June Workshop, IHK Akademie Westerham

  25. Build Management • Often overlooked • CMake is the (Kitware) answer, more about it later… NA-MIC, 2008 June Workshop, IHK Akademie Westerham

  26. Testing • Smoke test • does it compile • does it run and not crash • Regression testing • If something fails track, find the change and fix it • harder to implement • CTest/Cdash/DART are used; more about it later... NA-MIC, 2008 June Workshop, IHK Akademie Westerham

  27. Release Process • One person freezes and maintains the release branch • Two types of release • Binary • Source • CPack – tool to create release packages; more about it later NA-MIC, 2008 June Workshop, IHK Akademie Westerham

  28. Software Process Tools Summary • CMake – cross platform building • Dashboards, CTest, CDash, DART – continuous testing • Mailman Mailing List – Developer communication • Wiki – Store developer communication • Doxygen – Online documentation • Mantis Bug Tracker – keep track of bugs and feature requests • Revision control – cvs, svn • CPack – release management NA-MIC, 2008 June Workshop, IHK Akademie Westerham

  29. Software Process Tools Summary NA-MIC, 2008 June Workshop, IHK Akademie Westerham

  30. Conclusion • A set of tools, a set of rules and practices that creates a feedback loop resulting in higher quality code • But it does require some discipline • Paying attention to the dashboard • Picking enforcers • Creating tests NA-MIC, 2008 June Workshop, IHK Akademie Westerham NA-MIC, 2008 June Workshop, IHK Akademie Westerham June 16-17, 2008 30

  31. NA-MIC, 2008 June Workshop, IHK Akademie WesterhamCMake Sebastien BARRE, Ph.D. - Kitware, Inc.

  32. Why CMake • 1999 Start of the Insight Segmentation and Registration Toolkit (ITK) funded by NLM as part of the Visible Human Projectwww.itk.org • Kitware tasked with build environment • VTK current build system • autoconf on UNIX • pcmaker on Windows • Very specific to VTK and hard to maintain • CMake born out of necessity • 2006 KDE desktop adopted CMake NA-MIC, 2008 June Workshop, IHK Akademie Westerham

  33. CMake Features NA-MIC, 2008 June Workshop, IHK Akademie Westerham • Single input format for all platforms • Generate native build files • Visual Studio 6/7/8/9 • Nmake, borland make, unix make • Xcode • KDevelop • Eclipse • Platform inspection tool can search for • Programs • Libraries • Include paths • Determine hardware specifics like byte order

  34. CMake Features (cont.) • Linux, SunOS, HPUX, IRIX, Windows, Mac OSX, QNX, etc. • Simple, easy to use • Support complex, large build environments (KDE, ParaView, SecondLife) • Do not require any software other than CMake to be installed. • Need only a C++ compiler (same as ITK itself) • Full cross platform install system • Comes with a GUI layer for easy edition of input variables. NA-MIC, 2008 June Workshop, IHK Akademie Westerham

  35. Windows GUI CMakeLists.txt CMake Example Usage Userselects MSVCProject .NET Solution Makefile Unix GUI NA-MIC, 2008 June Workshop, IHK Akademie Westerham

  36. Configure Yes Did Cache Change? Generate Makefile or Project Write CMakeCache.txt No CMake GUI Process Flow NA-MIC, 2008 June Workshop, IHK Akademie Westerham

  37. A very simple project (see how easy it is!) Files needed: • Hello.c • CMakeLists.txt The CMakeLists.txt file would contain two lines: • PROJECT(Hello) • ADD_EXECUTABLE(Hello Hello.c) NA-MIC, 2008 June Workshop, IHK Akademie Westerham

  38. Basic CMake Syntax • COMMAND_NAME(space separated arguments) • command can be upper or lower case • SCREAM_COMMAND or quiet_command • Variables • SET(VAR value) • Semi-colon separated lists • SET(VAR “a b c”) - VAR holds one thing • SET(VAR a;b;c) or SET(VAR a b c) – VAR holds three things • LIST or FOREACH will get access to each thing NA-MIC, 2008 June Workshop, IHK Akademie Westerham

  39. Flow control (IF) NA-MIC, 2008 June Workshop, IHK Akademie Westerham IF(VAR) code ENDIF(VAR) IF(NOT VAR) IF(VAR AND VAR2) IF(VAR OR VAR2) IF(VAR MATCHES regular_expression) IF(COMMAND command) IF(EXISTS file) IF(VAR LESS VAR2)

  40. Flow control (FOREACH WHILE) NA-MIC, 2008 June Workshop, IHK Akademie Westerham foreach(F a b c) message(${F}) endforeach(F) while(VAR) message(${VAR}) set(VAR FALSE) endwhile(VAR)

  41. FIND_PACKAGE • Easy for smaller projects to use larger projects project(SampleProject) find_package(VTK REQUIRED) include(${VTK_USE_FILE}) set(SOURCES mySource1.cxx mySource2.cxx) add_executable(myExecutable ${SOURCES}) target_link_libraries(myExecutablevtkRendering) NA-MIC, 2008 June Workshop, IHK Akademie Westerham

  42. CMake Advanced Features • Shared library and DLL building • Support code generation at build time (VTK wrappers, Qt’s moc) • Create configured .h files • Automatic dependency generation • Parallel builds • Out of source builds • Command line support • Create OSX library frameworks and application bundles • Cross compiling • Integrated testing system called Ctest • Integrated packaging system called Cpack • Easy integration with CDash and Dart dashboard servers • And more... NA-MIC, 2008 June Workshop, IHK Akademie Westerham

  43. Find more about CMake… • Online documentation • http://cmake.org • Wiki • FAQ • Mailing list • Books • Mastering Cmake NA-MIC, 2008 June Workshop, IHK Akademie Westerham NA-MIC, 2008 June Workshop, IHK Akademie Westerham June 16-17, 2008 43

  44. NA-MIC, 2008 June Workshop, IHK Akademie WesterhamCPack Sebastien BARRE, Ph.D. - Kitware, Inc.

  45. CPack NA-MIC, 2008 June Workshop, IHK Akademie Westerham Cross platform packaging and distribution tool Package binary into native package format Distributed with CMake

  46. CPack Features NA-MIC, 2008 June Workshop, IHK Akademie Westerham • Support both CMake and Non-CMake projects • Unix: • TGZ, TZ, TBZ2, • STGZ (Self extract TGZ), • RPM • DEB • Windows: • NullSoft Scriptable Install System (NSIS), • ZIP • Mac OSX: • PackageMaker • OSXX11 (Mac OSX X11 Bundle)

  47. Using CPack • On Windows install command line ZIP program, and NSIS • Setup your project to work with CPack • Get make install to work • install(…) • make sure you executables work with relative paths and can work from any directory • set CPack option variables if needed (license, version, etc.) • include(CPack) • Run CPack • make package (create all packages) • make package_source (create source package) • cpack -C CPackConfig.cmake -G NSIS • cpack -C CPackConfig.cmake -G ZIP • cpack -C CPackSourceConfig.cmake -G ZIP NA-MIC, 2008 June Workshop, IHK Akademie Westerham

  48. Using CPack Simple Example project(CoolStuff) add_executable(coolstuff coolstuff.cxx) install(TARGETS coolstuff RUNTIME DESTINATION bin) SET(CPACK_PACKAGE_EXECUTABLES "coolstuff" "The Cool Stuff") # used by NSIS include(CPack) $ make package [100%] Built target coolstuff Run CPack packaging tool... CPack: Create package using NSIS CPack: Install projects CPack: - Run preinstall target for: CoolStuff CPack: - Install project: CoolStuff CPack: Compress package CPack: Finalize package CPack: Package C:/CoolStuffExample/CoolStuff-0.1.1-win32.exe generated. CPack: Create package using ZIP CPack: Install projects CPack: - Run preinstall target for: CoolStuff CPack: - Install project: CoolStuff CPack: Compress package CPack: Finalize package CPack: Package C:/CoolStuffExample/CoolStuff-0.1.1-win32.zip generated. NA-MIC, 2008 June Workshop, IHK Akademie Westerham

  49. Find more about CPack… • Online documentation • http://cmake.org • Wiki • http://www.cmake.org/Wiki/CMake:Packaging_With_CPack • http://www.cmake.org/Wiki/CMake:CPackConfiguration • http://www.cmake.org/Wiki/CMake:CPackPackageGenerators • Books • Mastering CMake NA-MIC, 2008 June Workshop, IHK Akademie Westerham NA-MIC, 2008 June Workshop, IHK Akademie Westerham June 16-17, 2008 49

More Related