Open Source.NET Development Setting Up A Professional Development Environment Using Open Source Software (OSS)
Morten Mertner Senior Consultant, Teknologisk Institut.NET Architect and Software Developer Developer of Gentle.NET (object persistence framework / ORM) MSCD.NET, MCT
Introduction Open Source Software Open Source Software Licensing Stability Support Picking the right tool
Introduction The Development Environment Setting Up A Professional Development Environment Unit Testing Documentation Source Control Automation Continuous Integration Issue Tracking
Open Source Software (OSS) Hosting SourceForce (www.sourceforge.net) 100.000+ projects FreshMeat II (www.freshmeat.net) 41.000+ projects GotDotNet (www.gotdotnet.com) 7.200+ projects Search Engines Koders (www.koders.com) 225,816,744 lines of code Why do it? Fame, Pride, Frustration, Love of Craft Powerful motivators
Licensing GPL (GNU Public License) Must publish all source changes Affects linked files (compile-time dependencies) 67% (freshmeat.net statistics) LGPL (Lesser GNU Public License) Must publish changes to component only Does not affect own project Can be used with closed-source commercial offerings 6% (freshmeat.net statistics) Apache, BSD, Creative Commons, MIT, others...
Stability and Support Activity Checks Forums Mailing lists Source repository Issue tracker Project statistics
Picking the right tool Trials Documentation and license reviews Hands-on testing and evaluation Usage reports (blogs, google groups)
Unit Testing What Module testing (black & white-boxed) Purpose Establish confidence Track progress Never fix the same error twice Additional Benefits Enables Test Driven Development Visibility (project status/progress, reporting)
Unit Testing xunit Tools NUnit MbUnit Frontends Command Line Default GUI TestDriven.NET ZaneBug
Unit Testing Demo Sample Code Creating your first test case Running the tests Evaluating the results TestDriven.NET Visual Studio integration ZaneBug Enhanced GUI
Documentation NDoc NDoc http://ndoc.sourceforge.net Standard.NET documentation tags (<summary>..</summary>) Benefits Create professional looking documentation Enable full Visual Studio integration (F1 help, IntelliSense) Strategy State purpose and document non-obvious information Always document all public methods, their parameters and return types Provide namespace summaries
Documentation NDoc Output HTML Windows Help (.chm) Visual Studio integration (.HxS) Support Tools Visual Studio Help Integration Toolkit http://download.microsoft.com/download/6/2/4/624a17d7-445f-499b-a2ed-82a06c36b370/vshik2003.exe H2Reg http://www.helpware.net/mshelp2/h2reg.htm
Source Control What Everything a developer needs to start working - source, libraries, build files, tools Anything NOT created by build process (documentation, binaries) Benefits Enables effective team work Revision control (labels, branches) Accountability Security (assuming the server is backed up)
Source Control Subversion Subversion WebDAV Cross-platform All modern SCM features (atomic commits, branching, move/rename, etc.) Strategy Use a dedicated development server (avoid file servers / network shares) Use included scripts to convert existing VSS repositories Don t spend much time on security (permit writes) Document most-used procedures and concepts Client installation Common tasks (checkout, update, commit, revert, diff and log)
Source Control Subversion Tools Command Line Subversion (svn) (http://subversion.tigris.org) Stand-alone GUI RapidSVN (http://rapidsvn.tigris.org) Windows Explorer integration TortoiseSVN (http://tortoisesvn.tigris.org) Visual Studio integration AnkhSVN (http://ankhsvn.tigris.org)
Automation What Repetetive tasks (usually also boring and error-prone) Benefits Reproducibility of build procedure Easy sharing of project setup Enables isolated build machine Scheduled builds Cross-compilation Complex scripting Task dependency management
Automation NAnt NAnt (inspired by Ant) http://nant.sourceforge.net XML syntax Tasks Compiling Validation and reporting (unit testing, FxCop) Packaging (installers, setup projects) Custom tasks Tools (graphical editors) NAnt-GUI NAntPad (commercial)
Automation NAnt Sample Build File <?xml version="1.0"?> <project name="nant" default="compile" xmlns="http://nant.sf.net/schemas/nant.xsd"> <target name="compile"> <solution solutionfile=..\source\calculator.sln configuration="debug" /> </target> </project>
Continuous Integration Continuous Integration Developer feedback on source repository actions Remote management and reporting Instant problem detection Early integration = early benefit
Continuous Integration CruiseControl.NET CruiseControl.NET (ThoughtWorks - Martin Fowler, GoF) http://ccnet.thoughtworks.com Web Dashboard CCTray Depends on Web Server / IIS Source repository (any) Build tool (NAnt, MSBuild, VS.NET) Integrates with NUnit / MbUnit FxCop
Continuous Integration Web Dashboard
Continuous Integration Web Project Status
Issue Tracking What Record all tasks that require human action Tasks Requirements (initial feature set) Bugs, supplemental features, tasks Benefits Progress visibility Accountability Reporting and statistics Version management (roadmapping)
Issue Tracking Mantis Mantis http://www.mantisbt.org Strategy Define projects, categories, permissions, etc. in advance - and keep them updated Create sub-tasks for non-actionable issues Always be specific ( fix documentation will not do) Enforce usage Create guidelines for reporting bugs if publicly accessible
Questions?