SDA SE Wiki

Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering

User Tools

Site Tools


FirstDayChallenge

Please read everything on this page to know what to do!

The goal of the First Day Challenge is to develop together a very small application which, nevertheless, contains already lots of the technology, we need in our lab. In particular, we aim to cover

  • Test first development (Unit Tests with jUnit)
  • From JTransformer to Prolog and back again
  • Contious Integration (SVN, CruiseControl, Traffic light)

The Story

We'd like to make the Factbase View of Eclipse configurable. Instead of showing just the number of source and bytecode classes we want

  • an option list for selecting whether the statistics should be for source code only / bytecode only / source and bytecode.
  • a table of abstract syntax tree node types from which the user can select the node types for which to display statistics.

The options should influence the diagram and the table displayed in the Factbase View. Here is what we envisage:

Current Factbase View Desired, Configurable Factbase View

Prepare your Working Environment

  • Start Eclipse 3.31) ( l:\work\eclipse3311-xp2008a ) with workspace “L:\work\workspace_<your login name>”
  • Add the SWI-Prolog bin path to the system PATH (Right click on My Computer→System Properties→Advanced Tab→Environment Variables; if Eclipse is running restart Eclipse to reflect the PATH change):

l:\Work\swiprolog\pl\bin

  • Check out these projects:

At first check out the following projects from the Prolog Development Tools (PDT) from the PDT repository path. The repository is read-only for you, because there should not be any need for you to modify the projects.

  • pdt
  • pdt.common
  • pdt.common.ui
  • pdt.console
  • pdt.core
  • pdt.feature
  • pdt.runtime
  • pdt.runtime.socket

Now check out the following projects from JTransformer repository. In the first day challenge you will only need to work on the jtransformer.factbaseview project.

  • jtransformer
  • jtransformer.pefnavigator
  • jtransformer.factbaseview
  • jtransformer.feature
  • jtransformer.rewriter
  • jtransformer.testing
  • jtransformer.testing.feature
  • st.java

If any of these projects contain errors after checking them out.

  • Clean all projects
  • Restart eclipse

Run existing JUnit Test of the JTransformer FactbaseView

* The JTransformer FactbaseView already comes with a JUnit test case. You find it in the project jtransformer.factbaseview:

 test/org/cs3/jtransformer/factbasevisualizer/JTransformerFactbaseViewTest.java

* Run the test case by right-clicking on the test and selecting

 Run As-> JUnit Plug-in Test

* There are two test predefined with different purposes. The show exemplary how you can test the view's GUI or the Prolog database content.

The the view in a runtime workspace

  • Select “Run→Open Run Dialog” in the Eclipse menu
  • Right-click on “Eclipse Application” and select “New”
  • Assign the name “JTransformer” to this new run configuration:

JTransformer Run Configuration

  • Click on the run button (From now on you can start the runtime workbench also via the run button Run Button (select a configuration via the small arrow on the right).
  • Once the new Eclipse workbench has been opened import the pl directory as project
    • Click File→Import→Existing Projects into Workspace
    • Select <your workspace location>\workspace\jtransformer.factbaseview\pl as the root directory
    • Now you should see the following: Import JTransformer Factbase View Prolog Project Import the shown project.
    • Create a simple Java test project with then name “JTTest”
    • Right-click on the new project and select “JTransformer Nature” and press the OK button in the pop-up dialog.
    • Now a factbase with the name “JTTest” is created with PEFs for the project
    • Open the Factbase View (JTransformer→Open Factbase View)
    • Open the Prolog console (Prolog→Open Console)
    • Click on the small arrow to the right of the Follow the Editor button in the Console toolbar and deselect the options “follow XX Editor”.
    • Select the JTTest Factbase via the select factbase button.
    • Select JTTest in the combo box in the Factbase View.
    • Open the file /JTFactbaseViewEngine/jtstatistics.pl. You can modify the prolog part of the view and see the result in the view immediately. Via Prolog→Consult (F9) you are able to consult your changes to fact base open in the Prolog console.

Divide & Conquer

Discuss the customer story and break it down into several separate tasks, so that each pair can provide its contribution to the whole game.

Starting points

  • The JTransformer Factbase View itself is defined in the class

/jtransformer.factbaseview/src/org/cs3/jtransformer/factbasevisualizer/JTransformerFactbaseView.java

  • You find the JUnit test case for the view in the source folder test:

test/org/cs3/jtransformer/factbasevisualizer/JTransformerFactbaseViewTest.java

  • The predicates you will need for this task are defined in the file (Prolog module)

/jtransformer.factbaseview/pl/jtstatistics.pl

Feel free to add new predicates to the file or create new file/module in the same directory if necessary. You will have to add a new consult line in the main.pl file to ensure that the file is consulted at JTransformer startup time.

Happy Coding

  • Don't forget to update often!
  • First test, than code.
  • Commit only running and tested code.
  • Commit often, commit early

Technical Details

1)
Make sure you are using the RCP/Plugin or Classic version which include the PDE and - of course - the right version number!
teaching/labs/xp/2008a/first_day_challenge.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2024