Download
introduction to software engineering tools and environments n.
Skip this Video
Loading SlideShow in 5 Seconds..
Introduction to Software Engineering: Tools and Environments PowerPoint Presentation
Download Presentation
Introduction to Software Engineering: Tools and Environments

Introduction to Software Engineering: Tools and Environments

153 Vues Download Presentation
Télécharger la présentation

Introduction to Software Engineering: Tools and Environments

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. Introduction to Software Engineering: Tools and Environments Session 9 Oded Lachish Room: Mal 405 Visiting Hours: Wednesday 17:00 to 20:00 Email: oded@dcs.bbk.ac.uk Module URL: http://www.dcs.bbk.ac.uk/~oded/Tools2012-2013/Web/Tools2012-2013.html

  2. Previously • Introduction to Build Tools (Ant) Today’s session • Introduction to Documentation Tools • Doxygen • eUML2 • Build Tools revisited • Introduction to Integration Tools

  3. Documentation Tools

  4. Documentation Tools • Extreme programmers believe that • “code is self documenting” • Maintenance is usually the longest part of a software products life • Regretfully there is a rumour that a large portion of the Hi-Tech jobs require the ability to do so. • Now imagine that you have to do the job without any documentation • Solution: Automation – dedicated tools

  5. Documentation Tools • What can documentation tools do for us? • Generate class diagrams (UML) – depicts the static relations between classes • Collaboration diagrams (UML) – depicts classes and their interactions • Search engine to code • and much more • When are these tools used? • As soon as possible (definitely before you need reverse engineering).

  6. Doxygen

  7. Doxygen A documentation system for C++, C, Java, Objective C, Fortran, VHDL, PHP, C#. • What can it do for us? • Generate on-line documents in HTML • Generate an off-line manual – latex, RTF (MS-Windows) • What does that include? • Dependency graphs • Inheritance diagrams • Collaboration diagrams • User specified information

  8. Doxygen • How does Doxygen generate all this information? • Doxygen can extract the code structure from the source files. • The user specified information is also generated from the source files, specifically from comments. • The underlying approach is to minimize the documents you need to create and simplify the process of updating them. If you update the comments when you update the code then the documentations also get updated.

  9. Doxygen Installation • Regretfully Doxygen is not an Eclipse plug-in • Download from: http://www.stack.nl/~dimitri/doxygen/download.html#latestsrc • Double click the downloaded file • The rest of the installation is standard

  10. Doxygen – preparing example code Lets start a new project Project name: Example10 Create one package named: allMyClasses Create a Junit test: TutorTest “TutorTest” should instantiate a class named Tutor with a constructor that accepts a string as a parameter and then call its method “whatYourName()” Snippets of the resulting code appear in the following slides

  11. Code for demonstration Tutor.java TutorTest.java package allMyClasses; /** * @author oded * */ public class Tutor { private String name; public Tutor(String string) { super(); name = string; } public void whatIsYourName() { System.out.println(name); } } package allMyClasses; import org.junit.Test; /** * @author oded * */ public class TutorTest { @Test public void test() { Tutor t= new Tutor("Oded"); t.whatIsYourName(); } }

  12. Doxygen GUI front end

  13. Doxygen- Selecting Directories Press

  14. Doxygen- Mode Options Press

  15. Doxygen- Output Options Press

  16. Doxygen- Diagram option

  17. Doxygen- Expert (maybe later)

  18. Doxygen- Run menu Press

  19. Doxygen- directory before and after

  20. Doxygen- the “index.html” file

  21. Doxygen- allMyClasses.Tutor From comment

  22. Doxygen- allMyClasses.Tutor changed comment The comment Now: save file and rerun Doxygen

  23. Doxygen- allMyClasses.Tutor changed name From comment

  24. Doxygen- class members

  25. Doxygen- packages

  26. Doxygen- file list

  27. Adding code to example Use refactoring to extract interface from class “tutor” Person.java package allMyClasses; public interface Person { public abstract void whatIsYourName(); } Now: save file and rerun Doxygen

  28. Doxygen – class hierarchy

  29. Doxygen – inheritance diagram

  30. Doxygen Create a new class that implements Person Teacher.java package allMyClasses; /** * @author oded * */ public class Teacher implements Person { private String name; public Teacher(String name) { super(); this.name = name; } /* (non-Javadoc) * @see allMyClasses.Person#whatIsYourName() */ @Override public void whatIsYourName() { System.out.println(name); } }

  31. Doxygen Create a new class that implements Person TutorTest.java package allMyClasses; import org.junit.Test; /** * @author ooded * */ public class TutorTest { @Test public void test() { Person classUnderTest= new Tutor("Oded"); Person classUnderTest2= new Teacher("Lance"); classUnderTest.whatIsYourName(); classUnderTest2.whatIsYourName(); } } Now: save file and rerun Doxygen

  32. Doxygen – with new class

  33. Doxygen – documenting code • In order to know which comments are for Doxygen the comment must have some additional marking (different marking for different languages) • JavaDoc Style marking, • for detailed description • (needs to be placed • before the member) • JavaDoc Style marking • for detailed description • (needs to be placed • before the member) required /** * …This does not do much… */ required /**< The name of the object */

  34. Doxygen – detailed description comment (before format)

  35. Doxygen – detailed description comment (after format)

  36. Doxygen – comment • One can also specify exactly where the comment belongs • “\enum” - to document an enumeration type • “\file” - to document a file • “\package” - to document a Java package. • “\interface” - to document an IDL interface • Formats /*! \file Teacher.java is a java file */ /*! @file Teacher.java is a java file */

  37. Doxygen – file comment

  38. Doxygen – not just inheritance diagrams Regretfully this requires another tool graphviz needed to generate more advanced diagrams and graphs. (open-source, cross-platform graph drawing toolkit be http://www.graphviz.org/ )

  39. Doxygen – other important features • Searching • Linking to external documentation • Customizing output • How to add support for new languages • Automatic link generation • Including formulae

  40. eUML2

  41. eUML2 • UML – unified modeling language- • Standardized general purpose modelling language for OO analysis and design. • eUML2 – a UML2 framework for eclipse

  42. eUML2 - installation eUML2 can be found at eclipse marketplace

  43. eUML2 – reverse engineering Right click project

  44. eUML2 – UML model Press

  45. eUML2 – What Happened? Press Press

  46. eUML2 – What Happened? Press Press

  47. eUML2 – Diagram Options Press

  48. eUML2 – Package Content Selection Press

  49. eUML2 – class diagram You can actually write code by editing the diagram. TRY it OUT!

  50. Build Tools Revisited