Skip to content

Projekttag

m4xxed edited this page May 12, 2023 · 22 revisions

Demo computers

The demo computers can be accessed remotely via Remote Desktop (RDP), yet only within the Unversity's VPN. They are:

  • stvive.informatik.uni-bremen.de
  • stvr1.informatik.uni-bremen.de
  • stvr2.informatik.uni-bremen.de

The following RDP connection settings should be used under the "Display" ("Anzeige") tab (the screenshot is in German, but the numbers can be used for other languages of Windows):
Resolution should be 1600x1200, and color depth should be 32 bit.

The user account is Projekttag. The credentials for this account are kept in BitWarden at entry 'Stvive, Stvr1 stvr2 RDP Remotedesktoverbindung'.

The SEE sources are checked out. Unity, Visual Studio 2019, and the Axivion Suite are installed.

Starting the server

  1. Connect via RDP as described above.
  2. Run TightVNC on the Desktop (make sure that Screen polling is set to 30ms. This should already be the case for the hosts mentioned above.)
  3. Run websockify.bat on the Desktop.

Important: You need to stay connected in your RDP session for the VNC server to stay active. Once you disconnect, the VNC server will cease to work.

You only need to run these once, they will continue in the background. To see whether the VNC server is running, you can check the program icons in the lower right. The TightVNC server will be present if it's running.

Now you'll be able to access noVNC at:

http://stvive.informatik.uni-bremen.de:5901/vnc.html?autoconnect=true&password=tryit&quality=7&compression=9
http://stvr1.informatik.uni-bremen.de:5901/vnc.html?autoconnect=true&password=tryit&quality=7&compression=9
http://stvr2.informatik.uni-bremen.de:5901/vnc.html?autoconnect=true&password=tryit&quality=7&compression=9

The password is tryit.

Analyze a project with the Axivion Suite

We will only use the token-based clone detector cpf to generate the GXL file for a software. This tool will work for C, C#, Java, C++. It does not require any knowledge about the build process and can analyze incomplete and even syntactically incorrect programs.

In the following, we assume the software of the project to be analyzed is located in a folder SRC. The following commands must be executed in an Axivion Command Prompt. Switch to directory SRC (one needs to have write permissions in this directory to save the results).

All-in-one script

Below each separate step of the analysis will be explained. All of these steps are implemented in one batch script named Data/GXL/scripts/runcpf.bat. This script expects one parameter specifying the programming language of the project as follows (always use lower-case letters):

  • c for C
  • cpp for C++
  • cs for C#
  • java for Java

It is expected to be executed in the directory where the source code to be analyzed is located. It will execute the commands explained below in the current directory.

Run the clone analysis with cpf

Gather the clones via cpf and save the results in intermediate files as follows (note: this example is for C; see the discussion of parameters below):

   cpf -m 100 -c clones.cpf -s clones.csv -a -i "*.c" -i "*.h" .

The relevant parameters are as follows:

  • Option -m allows you to specify the minimal length of a clone to be reported (in the number of tokens).
  • Option -c specifies the output file where the clone pairs are saved (in the cpf format).
  • Option -s specifies the output file where the clone statistcs are saved (in CSV format).
  • Option -a asks cpf to use absolute paths; this allows SEE to locate the source code when a source viewer is opened
  • Option -i specifies a file globbing for the files to be considered (multiple options of this kind are possible).

What programming language the content of a file is written in is determined by the file extenion as follows:

  • C: "i,c,h",
  • C++: "ii,cpp,cxx,c++,cc,tcc,hpp,hxx,h++,hh,C,H,inl,preinc",
  • C#: "cs",
  • Ada: "adb,ads,ada",
  • Java: "java",

Generate an RFG from the clone information

Import the clone data into a new RFG:

C:\Program Files (x86)\bauhaus\bin\cpfcsv2rfg clones.cpf clones.csv clones.rfg

Note: cpfcsv2rfg (as well as cpfcsv2rfg.py) are generally not distributed in the Axivion Suite. They must be installed separately.

Export the clone information in the RFG to a GXL file

The data in the RFG of the previous step are contained in a view named Clones. This view can be exported as follows:

rfgexport -o Clones -f GXL clones.rfg clones.gxl

The final result of the analysis is clones.gxl.

Clean up intermediate files no longer needed

You can delete the following files that are generated in the intermediate steps of the analysis as they will no longer be needed.

  • clones.cpf: contains the clone pairs
  • clones.csv: contains clone statistics
  • clones.rfg: the RFG containing the clone information
  • tokens.files: the files whose content was processed (lexical analysis)
  • tokens.tok: the complete list of tokens of all files processed

Visualize the GXL in SEE

Use the scene Projekttag.unity in Assets/Scenes.

In the game object CloneCity select the GXL generated above in section Data Files. The metric file should be left empty.

The metrics for leaf nodes should be as follows (mind the exact spelling):

  • Width: Metric.LOC
  • Height: Metric.Number_of_Tokens
  • Depth: Metric.LOC
  • Style: Metric.Clone_Rate

The metrics for inner nodes should be as follows:

  • Height: 0.001
  • Style: Metric.Level

The recommended layouts are as follows:

  • Treemap (with Blocks) or Circle Packing (with Cylinders) for nodes (do not use EvoStreets as this is currently broken, do not use Balloon because there will be a long chain from the root node when absolute file paths are generated by cpf).
  • Bundling for edges.

Feedback 2023

Einige Dinge, die wir nach dem Projekttag als Feedback gesammelt haben:

  • Briefing, wie SEE vorgestellt werden soll für alle vorstellenden
  • Präsentation vorher im Plenum üben
  • Projekttagsbranch mehr als 2 Tage vorher testen
  • Raum draußen? - Türschwelle ist eine Hemmschwelle
  • kein Schichtplan - jeder immer da?
  • großer Bildschirm mit Demo-Video?
  • Leute vor Türschwellen-Hemmschwelle?
  • SEE-T-Shirts