System Requirements Specification
System Requirements Specification (SRS) For Fixstyle
February 12, 2008
CPE 308-01
1.0 Introduction
1.1 Purpose
The purpose of this product is to provide a BlueJ extension that “beautifies” Java code by changing the style of the code to conform to either a standard code style or a customized code style given by the user.
1.2 Scope
This product provides a code formatter that merely extends BlueJ; it does not modify the IDE itself. Also this product formats only compiled code.
1.3 Product Features
Fixstyle’s modification capabilities include everything provided by Jalopy and :
- Turn inline conditionals into if-else statements
- BlueJ source code files stay compiled after a format with Fixstyle
- Enhancements to how Jalopy performs tasks:
-Header/Footer that can be added
-Tool tips that provide more information as to what each jalopy function does
-Option to use pre-loaded conventions
It also gives two options for what to modify:
- The current open source code
1.4 User Characteristics
Fixstyle is for Java programmers who prefer using the IDE BlueJ. It is designed for programmers of all levels, with standard code styles ready for use or customizable style options for the more advanced programmer. To be able to fully utilize this tool, the user needs to know what it means to have code conform to a style, i.e. GNU.
1.5 Constraints
None.
1.6 Assumptions And Dependencies
It is assumed Fixstyle is only meant to be run in the BlueJ environment, thus Fixstyle is dependent on BlueJ and will not run in any other IDE.
2.0 Functional Requirements
User Manual
3.0 Quality Attributes (Nonfunctional Requirements)
3.1 Operating Constraints
- J2SE 1.5.0 or newer installed.
- The program requires BlueJ version 2.2.1.
- The program requires a run-time of less than 30 sec per Kloc on minimum platform requirements.
3.2 Platform constraints
Minimum requirements: BlueJ version 2.2.1 with 64 Mb main memory and 450 MHz Pentium II processor or equivalent.
3.3 Modifiability, Adaptability
Each user is able to save their customized settings to the default folder.
3.4 Documentation
The user can access the User Manual, a text document for Fixstyle. The User Manual meets the standards of at least a level 4 of the Cal Poly Writing Proficiency Exam. The user can read the whole document within 2 hours. If the formatter fails to fix an error, a text dialogue box pops up on the screen to offer further explanation into the error.
3.5 Portability
The portability of this program ranges from any computer running Windows 98 or newer, Mac OS X or newer, Linux Red Hat, or Fedora Linux operating systems that meet the operating and platform constraints required to run BlueJ.
3.6 Reliability
If the extension closes itself, in the case of an error, the program does not cause BlueJ to crash.
Each time Fixstyle is run, it will correct unformatted Java code according to the preferences specified in the settings panel.
3.7 Security
The program only modifies files that it has access to. The program does not alter any functionality of the code that it formats.
3.8 Usability
A user can switch to Sun, Ansi, Kernighan and Ritchie, GNU or custom standards by choosing an option.
Saving conventions to a default file can be completed in under 5 minutes.
3.9 Testability
The formatter is run on Java code and any code that does not comply with the settings set by the user (or by default) in the Fixstyle Preference Setting Panel will be changed to be in accordance with the setting options.
For each implemented functional requirement, there will be example erroneous code. The formatter then runs the code through the formatter to show that it can fix that error in the code. Code with multiple errors in it also exist in the test cases to show that the code works to format several different errors correctly at the same time as well as fixes single errors in a document.
3.10 Deployment
Program package adheres to the BlueJ extension installation guide at http://www.bluej.org/extensions/extensions.htm#install
4.0 Behavioral Requirements
5.0 Informational Requirements
5.1 Data Model
5.2 Data Dictionary
Name: Blank Line
Alias: none
Description: a lines that consists of only whitespace
Definition: Blank Line = {Tab}n | {Spacing}n
Name: Braces
Alias: None
Description used to make “blocks” in the code syntax
Definition: Braces = String
Name: code
Alias: none
Description: any sequence of statements and/or declarations
written in some human-readable computer programming language
Definition: code = String
Name: Comments
Alias: none
Description: used to embed information in the source code that is ignored
Definition: Comments = String
Name: Control Statements
Alias: none
Description: Logical switches that controls the flow of code.
Definition: Control Statements = syntax + logic
Name: DisplayFile
Alias: Displayed File
Description: File displayed to screen.
Definition: DisplayFile = FormattedCode | UnformattedCode
Name: Dropdown Menu
Alias: None
Description: A menu on the UI whose menu items drop down in a list
upon selecting the menu.
Definition: Dropdown Menu = Options Menu + Program
Name: file
Alias: none
Description: resource of stored information
Definition: file = filename + code
Name: filename
Alias: none
Description: a special kind of string used to uniquely identify a
file stored on the file system of a computer
Definition filename = String
Name: Format
Alias: none
Description: a method of organizing data (as for storage)
Definition: Format = {Control Statements}n
Name: FormattedCode
Alias: none
Description: code that is ideally structured and easily eligible
Definition: FormattedCode = Format + Program + code
Name: Indentation
Alias: none
Description: place text farther to the right
Definition: Indentation = Tab | Spacing
Name: Javadoc
Alias: API
Description: a documentation generator from Sun Microsystems for
generating API documentation in HTML format from Java source code
Definition: Javadoc = {Comments}n
Name: Line Wrapping
Alias: none
Description: line wrapping confines text to the viewable window
Definition: Line Wrapping = New Line + Indentation + syntax
Name: Logic
Alias: none
Description: A statement that can hold one of two possible values.
Definition: Logic = True(Boolean) | False(Boolean)
Name: New Line
Alias: Carriage Returns
Description: end of line return to beginning of next line
Definition: New Line = A Java System “getProperty”
Name: Options
Alias: None
Description: Possible configurations for formatter in FixStyle
Options menu. Style feature selected by the user.
Definition: Options = Format | White Space | Control Statements | Line Wrapping | Comments
Name: Options Menu
Alias: Options Window
Description: The window that provides the options for selecting a
profile and selecting what style features to use.
Definition: Options Menu = {Options}n
Name: Package
Alias: None
Description: Java library
Definition: Package = {file}n
Name: Pentium II Processor
Alias: None
Description: Lowest standard of processors that is still able to run Fixstyle.
Definition: None
Name: Platform
Alias: None
Description: Computers that Fixstyle is compatible with.
Definition: None
Name: Profile
Alias: format style, Selected Style
Description: The set of style features saved by Fixstyle
Definition: Profile = file + Options
Name: Program
Alias: Fixstyle
Description: The formatting software.
Definition: Program = {file}n
Name: SourceFile
Alias: Source Code, Source
Description: The Java file that contains the original source code
whether its formatted or not.
Definition: SourceFile = FormattedCode | UnformattedCode
Name: Spacing
Alias: none
Description: used in code layout to be considered good programming style
Definition: Spacing = {Integer}n
Name: syntax
Alias: none
Description: the set of rules that a sequence of characters in a
source code file must follow to be considered a
syntactically conforming program in that language
Definition: syntax = Format + code
Name: Tab
Alias: none
Description: the tabulator key on a keyboard that is used to
advance the cursor to the next tab stop
Definition: Tab = spacing
0 <= spacing <= 32
Name: UnformattedCode
Alias: none
Description: code that may or may not be ideally structured and
easily eligible
Definition: UnformattedCode = code
Name: White Space
Alias: whitespace
Description: any single character or series of characters that
represents horizontal or vertical space in typography
Definition: White Space = {Tab}n | {Spacing}n | {Blank Lines}n | {New Lines}n
Standard Javadoc Library Terms are located at Java API
6.0 Appendices
6.1 Glossary
- API
- Acronym for application programming interface; a shell of the program that describes its interface rather than its implementation
- BlueJ
- Name of the IDE that this extension applies to
- Fixstyle
- Name of the extension this document describes
- IDE
- Acronym for integrated development environment; the most basic features usually include a code editor and a compiler
- Jalopy
- Name of the source code formatter that Fixstyle extends.
- Javadoc
- A documentation generator that creates an API for Java classes
- UI
- Acronym for user interface; what the user interacts with to use the product (Fixstyle)
6.2 External Interfaces
Software Interfaces
Fixstyle adds its own menu within the BlueJ's "Tools" menu to allow user access to Fixstyle and its features.
I/O Formats
.java
Fixstyle formats the style of only .java files.
.class
Fixstyle reads only .class files when users want to add their own extension.
6.3 Issues And Tradeoffs - Engineering Analysis
User Interface
Buttons On Toolbar
Advantages Eye pleaser.
Keeps Fixstyle grouped with BlueJ's functional buttons, making it more
convenient to find and use.
Disadvantages We could not find a feasible way to produce the desired functionality
(dropdown menu from a button).
Separate Toolbar
Advantages Eye pleaser.
Separates Fixstyle from the rest of BlueJ's buttons, while keeping it
convenient to find and use.
Disadvantages Again, we could not find a feasible way to produce the same desired functionality.
Dropdown Menu
Advantages User can quickly find the menu.
Disadvantages Takes up space on BlueJ's menu bar, which should strictly contain BlueJ's
original menus.
Menu Inside "Tools" Menu
Advantages Eliminates clutter on BlueJ's menu bar. Disadvantages Makes more difficult to find than putting the menu on BlueJ's menu bar.
Choice
We chose listing Fixstyle under the Tools menu over our the other options because the user could still find and use Fixstyle, while the UI with the menu on BlueJ's menu bar interferes with the user trying to find BlueJ's basic functions. As for the UI's involving buttons, we just could not find feasible ways to create them.
Option Customization
Customization UI
Advantages Choosing options through a UI appeals to more users. Disadvantages We estimate it would take us no more than a total of 1 day to write a UI.
User-written Configuration File
Advantages Allows for producing a finished product earlier (by 1 day). Disadvantages Takes more time and effort than just clicking on options on a UI.
Choice
We decided that providing the UI adds worthwhile functionality for the user since creating this interface adds only 1 day to our finish date.
6.3 FTR Review Summary report
signed by your reviewing group
6.4 QA Checklist
Attachments
- DataFlow.png (30.4 kB) -
The Data Flow Diagram
, added by whess on 02/07/08 09:44:56. - TwainLogo.jpg (5.8 kB) - added by whess on 02/07/08 09:48:34.


