SOFTWARE DEVELOPMENT BASICS SED Centre de recherche Lille Nord Europe 16 DÉCEMBRE 2011
SUMMARY 1. Inria Forge 2. Build Process of Software 3. Software Testing 4. Continuous Integration 16 DECEMBRE 2011-2
1 INRIA FORGE 16 DECEMBRE 2011-3
Inria Forge You will learn How To: Create and configure an Inria Forge account; Use the main features of Inria Forge; Use a source code manager (SCM). 16 DECEMBRE 2011-4
Inria Forge 1. What is Inria Forge? 2. How to get started? 3. Source code management (SCM). 4. Get support. 16 DECEMBRE 2011-5
What is Inria Forge? Wikipedia: «A software forge is a collaboration platform allowing collaborative software development over the Internet. [...] Software developers who are registered as contributors to the hosted projects can then use the various project management tools, and software development tools.» Associated tools: Source code management (svn and git); Web hosting, wiki; Bug tracker; File manager; Task manager; news, web forums... 16 DECEMBRE 2011-6
What is Inria Forge? When to use Inria Forge? Paper writing with other people; Software development; Paper or software collaboration with non-inria people. - Personal files! 16 DECEMBRE 2011-7
How to Get Started? Connect you on: https://gforge.inria.fr Create a user account Upload your ssh key Create a new project or ask to join an existing one 16 DECEMBRE 2011-8
Source Code Management A definition: «Source code management (SCM) is the task of tracking and controlling changes in the software, allows to recover older versions of your data and manages concurrent version.» Version Control System (VCS) in the Inria Forge: Subversion (centralized) Git (distributed) Centralized: only one central repository. Distributed: several repositories, peer to peer approach. 16 DECEMBRE 2011-9
Source Code Management Example with Subversion... Repository [//server/repository/] Working copy [~/my_project/] project 1 project 1 project 2 project 3 all versions «history» information folder structure : private workspace state information - trunk - branches - tags 16 DECEMBRE 2011-10
Source Code Management Example with Subversion... Repository [//server/repository/] Working copy [~/my_project/] Best Practice project 1 Prevent your code base from turning into a museum. project 1 project 2 project 3 all versions «history» information folder structure : private workspace state information - trunk - branches - tags 16 DECEMBRE 2011-11
Source Code Management Example with Subversion... checkout Developer A Repository Developer B 16 DECEMBRE 2011-12
Source Code Management Example with Subversion... development Developer A Repository Developer B 16 DECEMBRE 2011-13
Source Code Management Example with Subversion... development Developer A Best Practice Repository One change at a time. Developer B 16 DECEMBRE 2011-14
Source Code Management Example with Subversion... commit Developer A Repository Developer B 16 DECEMBRE 2011-15
Source Code Management Example with Subversion... update Developer A Repository Developer B 16 DECEMBRE 2011-16
Source Code Management Example with Subversion... commit Developer A Repository Developer B 16 DECEMBRE 2011-17
Source Code Management Example with Subversion... commit Developer A Repository Developer B 16 DECEMBRE 2011-18
Source Code Management Example with Subversion... merge Developer A Repository Developer B conflict 16 DECEMBRE 2011-19
Source Code Management Example with Subversion... diff Developer A Repository Developer B conflict 16 DECEMBRE 2011-20
Source Code Management Example with Subversion... commit Developer A Repository Developer B 16 DECEMBRE 2011-21
Decentralized Version Control System Anarchic Centralized Linux kernel model Branch by functionality or Release train How do you think of making to manage your project? 16 DECEMBRE 2011-22
Get Support Introduction: http://siteadmin.gforge.inria.fr/gforge.html FAQ: http://siteadmin.gforge.inria.fr/faq.html Support: help.et.gforge@inria.fr 16 DECEMBRE 2011-23
2 BUILD PROCESS OF SOFTWARE 16 DECEMBRE 2011-24
Build Process of Software You will learn How To: Automate different tasks of software development: Compiling source code into binary; Dependencies management; Software portability. 16 DECEMBRE 2011-25
Build Process of Software 1. What is the build? 2. Associated tools 3. Create a project 16 DECEMBRE 2011-26
What is the Build? A definition: «Build process consists in scripting or automating different tasks (compiling, packaging, running test...) that software developers do to build an operational software from source files.» Examples of tasks: Dependencies management; Software portability; Compilation; Software testing; Package management;... 16 DECEMBRE 2011-27
What is the Build? A definition: «Build process consists in scripting or automating different tasks (compiling, packaging, running test...) that software developers do to build an operational software from source files.» Best Practice Examples of tasks: Dependencies management; Three strikes Software portability; Compilation; Software testing; Package management;... and you automate. 16 DECEMBRE 2011-28
Tools (not exhaustive) C++ JAVA Make et Autotools; CMake; Qmake. ANT; Maven. 16 DECEMBRE 2011-29
CMake Developed by Kitware on BSD Licence, Cmake is a cross-platform, open-source system for managing the build process of software using a compiler independent method.
Maven Convention over configuration! Build tool ++ a set of standards, a project lifecycle, a dependency management system, and logic for executing plugin goals at defined phases in a lifecycle.
Build Process of Software You will learn How To: Implement unit testing; Implement integration testing. Practical class https://gforge.inria.fr/frs/download.php/29987/build.tar.gz 16 DECEMBRE 2011-32
Build Process of Software Feedback 16 DECEMBRE 2011-33
3 SOFTWARE TESTING 16 DECEMBRE 2011-34
Software Testing You will learn How To: Implement unit testing; Implement integration testing. 16 DECEMBRE 2011-35
Software Testing 1. Why software testing? 2. Main tests 3. Politic of testing 16 DECEMBRE 2011-36
Why Software Testing? A definition: «Software testing is an activity which allows to verify during development life cycle than a software respects functional requirements and specifications.» Minimizing the risks of failures. Testing is less costly than debugging (wikipedia) 16 DECEMBRE 2011-37
Main Tests Unit testing; Integration testing; Acceptance testing; Regression testing. 16 DECEMBRE 2011-38
Main Tests Unit testing; Integration testing; Best Practice Think of code and tests as one. Acceptance testing; Regression testing. Best Practice Don't change code without a test. 16 DECEMBRE 2011-39
Politic of Testing C++ JAVA CMake; Unit testing frameworks: CppTest; Unit++; CxxTest; Junit. Cobertura. Valgrind; LCOV. 16 DECEMBRE 2011-40
Software Testing Practical class https://gforge.inria.fr/frs/download.php/29992/tests.tar.gz 16 DECEMBRE 2011-41
Software Testing Feedback Requirements management Software testing and SCM 16 DECEMBRE 2011-42
4 CONTINUOUS INTEGRATION 16 DECEMBRE 2011-43
Continuous Integration You will learn How To: run and configure Jenkins; create new jobs; and bind jenkins with a SVN server. 16 DECEMBRE 2011-44
Continuous Integration 1. What is Continuous Integration? 2. First steps with Continuous Integration 3. Continuous Integration @ Lille 16 DECEMBRE 2011-45
What is Continuous Integration? Help to validate integration at each change on the project Comes from Extreme Programming (XP), as 1 of 12 original practices Improve quality of software Reduce the time to deliver it Automation is the way Automate recurrent tasks related to development environment build tests publish doc and executables Minimum daily 16 DECEMBRE 2011-46
CI Servers Common Features Build management Manually SCM polling Temporal scheduling Parallel (several projects simultaneously) Distributed Test reporting Notification email, IM, RSS,... 16 DECEMBRE 2011-47
First steps with Continuous Integration A single source code repository An automated build process A test suite A continuous integration software
Hudson Jenkins 16 DECEMBRE 2011-49
Hudson Jenkins 16 DECEMBRE 2011-50
Continuous Integration @ Lille Towards continuous integration as a service! Request a project at http://ci.lille.inria.fr/register Your project available at http://ci.lille.inria.fr/myproject Documentation : http://ci.lille.inria.fr
CI Servers Common Features Features Hosted web portal Backup Network Security Reliability Unix slave upon request Integration with other slaves Continuous Integration portal management Users Software revision Dedicated qualification area SSH key for slave connection 16 DECEMBRE 2011-52
Continuous Integration Practical class https://gforge.inria.fr/frs/download.php/29979/ci.tar.gz 16 DECEMBRE 2011-53
Continuous Integration Easier to find and remove bugs Continuous Integration reduces risks No long iteration, eliminate the blind spot At all time you know where you are Help to focus on tests Encourage more frequent deployments 16 DECEMBRE 2011-54
Thank you for your attention sed-lille@inria.fr https://sed.lille.inria.fr