Skip to content

srcML/stereocode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🛠 Stereocode 1.0

💡 What does it do?

Stereocode classifies methods and classes based on their stereotypes for C++, Java, and/or C# systems.

In addition, Stereocode stereotypes free functions as well as other structures (e.g., struct)

  • Please refer to the Wiki for detailed information on stereotypes

Stereocode takes a srcML archive as input, performs static analysis, and annotates each function and class tag in the XML input with an attribute indicating the detected stereotype. For example:

<class st:stereotype="entity"> ... </class>
<function st:stereotype="get"> ... </function>

🔧 Installation and Build

  1. Prerequisites
  1. Clone or download this repository.

  2. Build using cmake:

cmake CMakeLists.txt -B build_path
cd build_path
make

🚀 Usage

Stereocode is a command-line tool. It can process individual source files or whole systems.

Demo: 

# This line converts the PowerShell system to the srcML format
srcml PowerShell.zip -o PowerShell.xml

# Saves the output to PowerShell-output.xml
./stereocode PowerShell.xml -o PowerShell-output.xml

# For more options and help:
./stereocode --help

📜 Stereocode Options

-o, --output-file: File name of output - srcML archive with stereotypes.

-p, --primitive-file: File name of user supplied primitive types (one per line).

Datatype_1
Datatype_2
...

These data types will be treated as primitive data types such as an int.

-g, --ignore-call-file: File name of user supplied calls to ignore (one per line).

Call_Name_1
Call_Name_2
...

Do not use namespaces, parenthesis, or other special characters. Simply list the call name itself. For example, foo.
These calls are ignored from analysis. However, usage of fields within these calls (as parameters) are not ignored (considered as accessors to attributes).

-t, --type-modifier-file: File name of user supplied data type modifiers to remove (one per line).

modifier_1
modifier_2
...

These modifiers, such as public, are removed during analysis to enhance the detection of certain elements such as primitive data types and method return types.

-l, --large-class [int]: Method threshold for the large-class stereotype (default = 21).

-f, --free-function: Identify stereotypes for free functions (C++, C#, and Java).

-i, --interface: Identify stereotypes for interfaces (C# and Java).

-n, --union: Identify stereotypes for unions (C++).

-m, --enum: Identify stereotypes for enums (Java).

-s, --struct: Identify stereotypes for structs (C# and Java).

-e, --input-overwrite: Overwrite input with stereotype information.

-x, --txt-report: Output optional TXT report file containing stereotype information.

-z, --csv-report: Output optional CSV report file containing stereotype information.

-c, --comment: Annotates stereotypes as a comment before method and class definitions (/** @stereotype stereotype */).

-v, --verbose: Outputs default primitives, ignored calls, type modifiers, and extra report files.

About

A tool for the automatic identification of stereotype information in software systems

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 6

Languages