0% found this document useful (0 votes)
4 views71 pages

Encoder Program Development Report

abc

Uploaded by

Minh Đức
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views71 pages

Encoder Program Development Report

abc

Uploaded by

Minh Đức
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

COMP1551 - Application Development

COURSEWORK
Word Count: 5222 words

Tutor: Dr. Hoang Dinh Cuong


Student: Cao Minh Duc– GCH230132
4-25-2025
Table of Contents
Description of the System .............................................................................................. 4
Part 1: Development of the Encoder Program .................................................................. 5
Version 1: StringProcessing ........................................................................................ 5
1. Constructor Correctly Implemented (15 pts) ..................................................... 5
2. Encode Method Correctly Implemented (35 pts) ................................................ 6
3. Print Method Correctly Implemented (5 pts) ...................................................... 7
4. InputCode Method Correctly Implemented (5 pts) ............................................. 7
5. OutputCode Method Correctly Implemented (5 pts) .......................................... 8
6. Sort Method Correctly Implemented (5 pts) ....................................................... 8
7. Utilize Data Validation via Property (5 pts) ......................................................... 8
8. Utilize Encapsulation (5 pts) ............................................................................. 9
9. All Methods Successfully Tested in Main Method (10 pts) ................................. 10
Version 2: Encoder ................................................................................................... 11
Goal: ................................................................................................................... 11
Design and Implementation .................................................................................. 12
1. Constructor Correctly Implemented (15 pts) ................................................... 12
2. Encode Method Correctly Implemented (35 pts) .............................................. 13
3. Print Method Correctly Implemented (5 pts) .................................................... 14
4. InputCode Method Correctly Implemented (5 pts) ........................................... 15
5. OutputCode Method Correctly Implemented (5 pts) ........................................ 17
6. Sort Method Correctly Implemented (5 pts) ..................................................... 17
7. Data Validation via Property and Method (5 pts) ............................................... 17
8. Utilize Encapsulation (5 pts) ........................................................................... 19
9. Test Main Method (10 pts) .............................................................................. 19
Version 3: WinForms App ......................................................................................... 21
Goal: ................................................................................................................... 21
Description: ......................................................................................................... 21
Part 2: Software Requirements Specification for Encoder Program ................................. 22
1. Introduction......................................................................................................... 22
1.1. Purpose ........................................................................................................ 22
1.2. Project Scope ................................................................................................ 23
2. Overall Description .............................................................................................. 23
2.1. Product ......................................................................................................... 23
2.2. Users ............................................................................................................ 23
2.3. Operational Environment ............................................................................... 23
3. System Features .................................................................................................. 23
3.1. Description ................................................................................................... 23
3.2. Functional Requirements ............................................................................... 23
4. User Interface Requirements ................................................................................ 24
5. Platform Requirements......................................................................................... 24
6. Quality Attributes ................................................................................................. 24
6.1. Performance ................................................................................................. 24
6.2. Security ........................................................................................................ 24
6.3. Safety ........................................................................................................... 24
Part 3: UML Diagram .................................................................................................... 25
Version 1: StringProcessing ...................................................................................... 25
[Link] ................................................................................................... 25
2. UseCaseDiagram ............................................................................................. 26
Version 2-3: Encoder ................................................................................................ 27
[Link] Diagram ................................................................................................... 27
2. UseCaseDiagram ............................................................................................. 28
4. Testing .................................................................................................................... 29
[Link] ..................................................................................................... 29
2. Encoder .............................................................................................................. 31
3. Winform Test Case ............................................................................................... 36
5. Future Development: ............................................................................................... 40
6. Appendix ................................................................................................................ 41
1. Encoder .............................................................................................................. 41
1.1. SaveHistoryCode ........................................................................................... 41
1.2. ProcessStringEncoding .................................................................................. 43
1.3. ProcessNumberEncoding ............................................................................... 45
2. TestCase Evidence ............................................................................................... 46
2.1. String Processing ........................................................................................... 46
2.2. Encoder ........................................................................................................ 48
2.3. Winform ........................................................................................................ 57

Table of Figures
Figure 1 Encoder Winform Version ................................................................................ 22
Figure 2 String Processing Class Diagram ...................................................................... 25
Figure 3 String Processing Use Case Diagram ................................................................ 26
Figure 4 Encoder Class Diagram ................................................................................... 27
Figure 5 Encoder Use Case Diagram ............................................................................. 28

Description of the System


The report outlines the development journey of the Encoder Program, from its initial phase
with basic functionalities to an enhanced version and ultimately a user-friendly WinForms
interface. Initially, the program handled simple string processing, focusing on uppercase
input and character shifting. The upgraded version expanded capabilities, supporting
diverse encoding methods for both strings and numbers, with history tracking stored in an
Excel file, improving flexibility and interaction. The WinForms interface integrates all
console logic, offering an intuitive experience with easy-to-use controls for input, encoding
selection, and history viewing. The program enables users to encode data efficiently,
ensuring accuracy and convenience for basic security tasks.
Part 1: Development of the Encoder Program
The following below outlines the implementation of a full encoder program through 3
versions of development, StringProcessing with core Caesar Cipher functionality,
Encoder with expanded encoding methods and history logging, and a WinForms App that
integrates the console logic into a user-friendly GUI. Each version meets specific criteria,
ensuring robust functionality and user interaction.

Version 1: StringProcessing
Goal: Implement a foundational class for encoding capital-letter strings using a Caesar
Cipher, with validation, encapsulation, and comprehensive testing.

1. Constructor Correctly Implemented (15 pts)


o Code: <<Constructor code>>
o Explanation: The constructor initializes the private fields S (input string), N
(shift value), and encoded (result). It uses a loop-and-reprompt mechanism
to ensure valid user input, enforcing uppercase letters (A–Z) for S and a range
of -25 to 25 for N.

This helps focus on reliable input handling and helps meet the criteria for
data validation, user guidance, and program robustness.

2. Encode Method Correctly Implemented (35 pts)


o Code: <<Encode method code>>
o Explanation: The Encode method applies a Caesar Cipher, shifting each
character in S by N positions within the A–Z range, handling wrap-around for
shifts past 'Z' or before 'A'. It supports both positive and negative shifts,
ensuring accurate encoding. This core functionality is the foundation for the
Description of the System’s mention of simple string encoding.

3. Print Method Correctly Implemented (5 pts)


o Code: <<Print method code>>

o Explanation: The Print method simply returns the last encoded string stored
in the private encoded field.

4. InputCode Method Correctly Implemented (5 pts)


o Code: <<InputCode method code>>

o
o Explanation: This method converts each character of input S to its ASCII
code then return it. This feature helps meet the Requirements criteria on
ASCII input for analysis.

5. OutputCode Method Correctly Implemented (5 pts)


o Code: <<OutputCode method code>>

o Explanation: The OutputCode method returns ASCII codes for the encoded
string, handling the case where no encoding has occurred by returning an
empty array. This feature helps meet the Requirements criteria on ASCII
output and data validation for analysis.

6. Sort Method Correctly Implemented (5 pts)


o Code: <<Sort method code>>

o Explanation: The Sort method arranges characters of S in ascending order,


returning the sorted string.

7. Utilize Data Validation via Property (5 pts)


o Code: <<S and N property code>>
o Explanation: The S property enforces that input strings contain only
uppercase A–Z letters and are ≤40 characters, while the N property restricts
shift values to -25 to 25. Invalid inputs raise exceptions, triggering reprompts
in the constructor.

o This robust validation aligns with the Description of the System’s focus on
input integrity.

8. Utilize Encapsulation (5 pts)


o Code: <<Field and property declarations>>
o Explanation: Private fields S, N, and encoded are accessed only through
public properties (S, N) or methods (Encode, Sort, etc.), ensuring data
integrity and hiding implementation details.

o This encapsulation is a key aspect of StringProcessing in the Description of


the System.

9. All Methods Successfully Tested in Main Method (10 pts)


o Code: <<Main method code>>
o Explanation: The Main method instantiates a StringProcessing object, tests
all public methods (encoding, printing, ASCII conversion, sorting), and
displays results on the console. It demonstrates the class’s API end-to-end,
including original and reverse encoding tests to verify correctness.

o This comprehensive testing supports the Description of the System’s


emphasis on functional validation.

Version 2: Encoder
Goal:
Extend StringProcessing into a versatile Encoder class supporting multiple encoding
algorithms for strings and numbers, with history logging, Excel export, and integration
hooks for a GUI.
Design and Implementation
• Constructor:

o Sets up private fields: history list, Excel path, sorted flag, original input.

• Public API Methods:

o Encode(input, type, parameter): Chooses algorithm, runs it, logs the


operation.

o InputCode(): Prompts/validates input, applies sorting if requested, displays


ASCII.

o OutputCode(encoded): Shows the encoded result and ASCII codes.

o PrintHistory(): Clears console and lists timestamped history entries.

• Helpers & Validation:

o DataValidation: Enforces non-empty, digit-only or letter-only rules.

o Sort: Alphabetically orders a string and flags it.

o Algorithm methods (CaesarCipher, ConvertToBase, etc.) handle specific


logic.

o SaveHistory: Appends a timestamped EncodeHistoryItem and writes to


Excel when needed.

1. Constructor Correctly Implemented (15 pts)


o Code: <<Encoder constructor code>>

o
o Explanation: The constructor initializes private fields: historyItems
(encoding history list), historyExcelPath (Excel file path), isSorted (sorting
flag), and originalInput (raw input).

o It ensures the object is ready for immediate use, as described in the


Description of the System for the advanced Encoder setup.

2. Encode Method Correctly Implemented (35 pts)


o Code: <<Encode method code>>
<<Save History code>>

o Explanation: The Encode method is the central entry point, selecting an


algorithm (e.g., Caesar Cipher, XOR, Base Conversion) based on input type
(string or number) and encoding type. It validates inputs, applies the chosen
transformation, and logs the operation in historyItems and eventually Excel

o This versatility is a cornerstone of the Description of the System’s mention of


multiple encoding methods.

3. Print Method Correctly Implemented (5 pts)


o Code: <<Print method code>>
o Explanation: The Print method clears the console and displays the encoding
history, showing timestamps, original inputs, encoded outputs, and
encoding types.

o It handles empty histories gracefully, supporting the Description of the


System’s history tracking feature.

4. InputCode Method Correctly Implemented (5 pts)


o Code: <<InputCode method code>>
o Explanation: This method prompts for user input, applies DataValidation to
ensure compliance (letters for strings, digits for numbers), and offers
optional sorting for strings. It displays ASCII codes of the input, aligning with
the Description of the System’s focus on validated input processing.

5. OutputCode Method Correctly Implemented (5 pts)


o Code: <<OutputCode method code>>

o Explanation: The OutputCode method displays the encoded result and its
ASCII codes, providing a clear output summary. This functionality supports
the Description of the System’s emphasis on result presentation.

6. Sort Method Correctly Implemented (5 pts)


o Code: <<Sort method code>>

o Explanation: The Sort method alphabetically sorts a string’s characters,


updating the isSorted flag. It is used optionally during input processing, as
noted in the Description of the System for preprocessing flexibility.

7. Data Validation via Property and Method (5 pts)


o Code: <<DataValidation method code>>
o Explanation: The DataValidation method ensures inputs are non-empty, with
numbers parsing as integers (≤40 digits) and strings containing only
uppercase A–Z letters (≤40 characters). Invalid inputs trigger specific error
messages, ensuring robust state management, as highlighted in the
Description of the System.

8. Utilize Encapsulation (5 pts)


o Code: <<Field declarations and public API>>

o Explanation: Private fields (historyItems, historyExcelPath, etc.) are


accessible only through public methods (Encode, Print, etc.), hiding helper
methods and internal logic. This encapsulation ensures a clean API, as
described in the Description of the System.

9. Test Main Method (10 pts)


o Code: <<Main method code>>
<<ProcessStringEncoding>>

<<ProcessNumberEncoding>>

o Explanation: The Main method provides a console-based interface, offering


a menu for encoding strings, numbers, viewing history, or exiting. It uses a
switch-case to delegate to ProcessStringEncoding or
ProcessNumberEncoding, catches exceptions, and ensures a smooth user
experience. This aligns with the Description of the System’s focus on
interactive testing.

Version 3: WinForms App


Goal:
Transform the Encoder console logic into a graphical WinForms application, reusing all
core functionality for a user-friendly experience.

Description:
The interface is organized into clearly defined sections:

• Input Type: Allows users to select between String or Number inputs, with optional
sorting for strings.

• Encoding Options: Users can choose the desired encoding method from a
dropdown list.

• Parameters: Includes input fields for Shift Value, Target Base, and Key Value
depending on the selected encoding type.

• Output: Displays the encoded/decoded result, along with its ASCII representation.

• History: A list box (lstHistory) logs previously processed entries for reference.

• Generate Button: Executes the encoding process using the selected options and
input parameters.
Figure 1 Encoder Winform Version

Part 2: Software Requirements Specification for Encoder


Program
1. Introduction
1.1. Purpose
This document specifies the requirements for the Encoder Program, a tool designed to
encode strings and numbers using various algorithms, providing a user-friendly interface
for secure data transformation. It outlines functional and non-functional requirements to
guide development and ensure alignment with user needs.
1.2. Project Scope
The Encoder Program evolves from a basic string processor to a versatile encoder with
multiple algorithms and a WinForms GUI. It supports encoding, history tracking, and Excel
export, targeting users needing simple data encoding for educational or lightweight
security purposes. The scope excludes advanced cryptographic features or cloud
integration.

2. Overall Description
2.1. Product
The Encoder Program processes uppercase A–Z strings and integers, offering encoding
methods like Caesar Cipher, XOR, Atbash, Base Conversion, and more. It maintains an in-
memory encoding history, exportable to Excel, and provides a WinForms interface for
intuitive interaction, reusing console logic for reliability.

2.2. Users
The primary users are students, educators, and hobbyists interested in basic encoding
techniques. They require an accessible tool for learning or applying simple data
transformations, with minimal technical expertise assumed.

2.3. Operational Environment


The program operates on Windows systems with .NET Framework 4.7.2 or higher,
supporting console and WinForms interfaces. It requires local storage for Excel history files
and the OpenXML library for file operations.

3. System Features
3.1. Description
The system supports encoding strings (e.g., Caesar Cipher, XOR) and numbers (e.g., Base
Conversion, Bitwise NOT), with optional string sorting and ASCII code display. It logs
encoding operations and exports history to Excel, with a GUI for user interaction.

3.2. Functional Requirements


• FR1: Encode uppercase A–Z strings (≤40 characters) using Caesar Cipher, XOR,
Atbash, or Reverse Text, with user-defined parameters (e.g., shift value).

• FR2: Encode integers (≤40 digits) using Base Conversion, XOR, Bitwise NOT, or
Binary Formatter.
• FR3: Validate inputs, rejecting non-uppercase letters for strings or non-integers for
numbers.

• FR4: Maintain an in-memory encoding history with timestamps, inputs, outputs,


and parameters.

• FR5: Export history to an Excel file, appending new entries without overwriting.

• FR6: Provide a WinForms GUI to input data, select encoding types, view results, and
display history.

4. User Interface Requirements


The WinForms interface must include text fields for input and parameters, dropdowns for
encoding type selection, buttons for encoding and history viewing, and a display area for
results and ASCII codes. It should be intuitive, with clear error messages for invalid inputs.

5. Platform Requirements
The program requires Windows 10 or later, .NET Framework 4.7.2+, and the
[Link] library. It needs 100 MB of storage for the application and
Excel files, with 512 MB RAM for smooth operation.

6. Quality Attributes
6.1. Performance
The system must process encodings in <1 second for inputs ≤40 characters/digits and
export history to Excel in <2 seconds for up to 100 entries.

6.2. Security
Input validation prevents invalid data from corrupting the system. History files are stored
locally without encryption, suitable for non-sensitive educational use.

6.3. Safety
The program poses no safety risks, handling only user-provided data without external
network access or critical system interactions.
Part 3: UML Diagram
The following UML diagrams represent the design of the StringProcessing Program and
Encoder Program, as developed in Part 1. The StringProcessing Program focuses on
basic Caesar Cipher encoding, while the Encoder Program supports multiple encoding
methods, history tracking, and a WinForms GUI. These diagrams align with the Description
of the System, reflecting the evolution from a simple encoder to a versatile system with a
user-friendly interface.

Version 1: StringProcessing
[Link]

Figure 2 String Processing Class Diagram

Caption: The Class Diagram for the StringProcessing Program illustrates a simple
structure with the StringProcessing class encapsulating Caesar Cipher logic and the
Program class driving the console-based testing.

The StringProcessing class includes private fields (s, n, encoded) with validated public
properties (S, N) and methods for encoding, sorting, and ASCII code display. The Program
class depends on StringProcessing, instantiating it in the Main method to execute the
program’s functionality, aligning with the Description of the System’s focus on basic string
encoding.
2. UseCaseDiagram

Figure 3 String Processing Use Case Diagram

Caption: The Use Case Diagram for the StringProcessing Program depicts user
interactions with a basic encoding system. The primary use case, Apply Caesar Cipher,
allows the user to encode an uppercase A–Z string, optionally sorting it first (Sort String
Input). It includes sub-actions to view the input and output ASCII codes (View Input ASCII
Codes, View Output ASCII Codes) and the encoded result (View Encoded Output). This
reflects the Description of the System’s emphasis on a foundational Caesar Cipher tool
with supporting features for analysis and preprocessing.
Version 2-3: Encoder
[Link] Diagram

Figure 4 Encoder Class Diagram

Caption: The Class Diagram for the Encoder Program showcases a modular design with
the Encoder class as the core, managing multiple encoding methods and history tracking
via EncodeHistoryItem. The Program class drives the console interface, depending on
Encoder to execute encoding tasks, while WinFormsApp extends this functionality with a
GUI, reusing Encoder’s logic. This structure supports the Description of the System’s
narrative of an advanced encoder with history logging and a user-friendly interface.

2. UseCaseDiagram

Figure 5 Encoder Use Case Diagram

Caption: The Use Case Diagram for the Encoder Program illustrates a comprehensive
encoding system. The central Encode use case enables users to encode strings or
numbers, involving sub-actions like Input String, Input Number, Select Input Type, Select
Encoding Type, Set Encoding Parameters, and viewing results (View Input ASCII Codes,
View Output ASCII Codes, View Encoded Output). Optional sorting (Sort String Input) and
automatic history export (Export History to Excel) enhance functionality, while View History
allows history review. This aligns with the Description of the System’s focus on a versatile
encoder with history tracking and GUI support.
4. Testing
[Link]

Test ID Sub
Big Test
Test Case Test Input Expected Evidence Pass/Fail
Case
Case
String SE-01 Input Valid Proceed to shift Evidence
"HELLO" Pass
Encoding String Input 1 value prompt
SE-02 "ABCDEFGHIJ Evidence
Valid Proceed to shift
KLMNOPQRS Pass
Input 2 value prompt
TUVWXYZ"
SE-03 Inform Error and Evidence
Empty
"" reask for string Pass
Input
input.
SE-04 Special Inform Error and Evidence
Charac "HELLO!" reask for string Pass
ters input.
SE-05 Inform Error and Evidence
Digits
"HELL0" reask for string Pass
in Input
input.
SE-06 Non- Inform Error and Evidence
Capital "hello" reask for string Pass
Letters input.
SE-07 Exceed Evidence
Inform Error and
s 40
"A" * 41 reask for string Pass
Charac
input.
ters
SE-08 Valid Proceed to Evidence
Input Shift
Shift "5" encoding -> Pass
Value
Value 1 encoded Output
SE-09 Valid Proceed to Evidence
Shift "-5" encoding -> Pass
Value 2 encoded Output
SE-10 Empty Evidence
Prompt to enter a
Shift "" Pass
valid Integer.
Input
SE-11 Non- Prompt to enter a Evidence
"abc" Pass
Integer valid Integer..
Shift
Input
SE-12 Shift Evidence
Prompt value
Outsid
must be an
e "26" Pass
integer between -
Bounda
25 and 25.
ry 1
SE-13 Shift Print "Shift value Evidence
Outsid must be an
e "-26" integer between - Pass
Bounda 25 and 25." and
ry 2 reask.
SE-14 Return: Evidence
Original="HELLO",
Shift=5, ASCII
Input=[72,69,76,7
Valid Input: 6,79],
Program Encoding
Encodi "HELLO", Sorted="EHLLLO", Pass
Output Output
ng 1 Shift: "5" ASCII
Output=[77,74,81,
81,84],
Encoded="MJQQT
".
SE-15 Return: Original=" Evidence
ABCDEFGHIJKLM
NOPQRSTUVWXY
Z ", Shift=-5,

ASCII Input = [ 65,


66, 67, 68, 69, 70,
71, 72, 73, 74, 75,
Input: 76, 77, 78, 79, 80,
Valid "ABCDEFGHIJ 81, 82, 83, 84, 85,
Encodi KLMNOPQRS 86, 87, 88, 89, 90],
ng 2 TUVWXYZ",
Shift: "-5" Sorted="ABCDEF
GHIJKLMNOPQRS
TUVWXYZ ",

ASCII Output =
[86, 87, 88, 89, 90,
65, 66, 67, 68, 69,
70, 71, 72, 73, 74,
75, 76, 77, 78, 79,
80, 81, 82, 83, 84,
85],
Encoded="VWXYZ
ABCDEFGHIJKLM
NOPQRSTU".

2. Encoder
Big Test TestID Test Sub Test Input Expected Evidence Pass/Fail
Case Case Case
Choose EC-1 Input Valid Input "HELLO" Proceed to sort Evidence Pass
1: Encode String prompt
String
EC-2 Empty "" Print "Input cannot Evidence Pass
Input be empty." and
reprompt.
EC-3 Special "HELLO!" Print "String input Evidence Pass
Character should not contain
s digits or any special
character." and
reprompt.
EC-4 Digits in "HELL0" Print "String input Evidence Pass
Input should not contain
digits or any special
character." and
reprompt.
EC-5 Non- "hello" Print "String input Evidence Pass
Uppercase must contain only
Letters uppercase letters
(A–Z)." and
reprompt.
EC-6 Exceeds "A" * 41 Print "String must be Evidence Pass
40 40 characters or
Character fewer." and
s reprompt.
EC-7 Sort Valid Yes "yes" or "y" Sort string Evidence Pass
Input Response alphabetically, print
Prompt "Sorted Value:
[sorted string]",
display ASCII codes,
set isSorted=true,
proceed to
encoding.
EC-8 Valid No "no" or "n" Display ASCII codes Evidence Pass
Response of original string, set
isSorted=false,
proceed to
encoding.
EC-9 Empty "" Print "Invalid Evidence Pass
Input response. Please
enter 'yes', 'y', 'no', or
'n'." and reprompt.
EC-10 Invalid "maybe" Print "Invalid Evidence Pass
Response response. Please
enter 'yes', 'y', 'no', or
'n'." and reprompt.
EC-11 Select Empty "" Print " Invalid Evidence Pass
Encodin Input encoding type.
g Type Please try again”
and reprompt
EC-12 Invalid "50" Print " Invalid Evidence Pass
Input encoding type.
Please try again”
and reprompt.
EC-13 Encodin Valid Shift "5" Encode to "MJQQT", Evidence Pass
g Type: Value print ASCII codes,
Caesar save to history,
Cipher update Excel, save
into history, return
to main menu.
EC-14 Empty "" Print "Shift value Evidence Pass
Shift Input must be a valid
integer." and
reprompt.
EC-15 Invalid "26" Print "Shift value Evidence Pass
Shift Value must be an integer
1 between -25 and
25." and reprompt.
EC-16 Invalid "abc" Print "Shift value Evidence Pass
Shift Value must be a valid
2 integer." and
reprompt.
EC-17 Encodin Valid Key "10" Perform XOR, print Evidence Pass
g Type: Value encoded result and
XOR ASCII codes, save to
Cipher history, update
Excel, save into
history, return to
main menu.
EC-18 Empty Key "" Print "Key value Evidence Pass
Input must be a valid
integer." and
reprompt.
EC-19 Invalid Key "256" Print "Key value for Evidence Pass
Value 1 XOR Cipher must be
between 0 and 255."
and reprompt.
EC-20 Invalid Key "abc" Print "Key value Evidence Pass
Value 2 must be a valid
integer." and
reprompt.
EC-21 Encodin No "HELLO" Encode to "OLLEH", Evidence Pass
g Type: Parameter print ASCII codes,
Reverse save to history with
Text parameter=0,
update Excel, save
into history, return
to main menu.
EC-22 Encodin No "HELLO" Encode to "SVOOL", Evidence Pass
g Type: Parameter print ASCII codes,
Atbash save to history with
Cipher parameter=0,
update Excel, save
into history, return
to main menu.
Choose EN-1 Input Valid Input "12345" Display ASCII codes Evidence Pass
2: Encode Number of input string,
Number proceed to encoding
options.
EN-2 Empty "" Print "Input cannot Evidence Pass
Input be empty." and
reprompt.
EN-3 Non- "12.34" Print "Input must be Evidence Pass
Integer a valid integer." and
Input 1 reprompt.
EN-4 Non- "abc" Print "Input must be Evidence Pass
Integer a valid integer." and
Input 2 reprompt.
EN-5 Exceeds 214748364 Print "Input must be Evidence Pass
Int32 Limit 8 a valid integer." and
reprompt..
EN-6 Select Empty "" Print "Please enter a Evidence Pass
Encodin Input valid option." and
g Type reprompt.
EN-7 Invalid "5" Print "Invalid choice. Evidence Pass
Input Please select from 1
to 4." and reprompt.
EN-8 Encodin Valid "16" Encode to "3039" Evidence Pass
g Type: Target (hex), print ASCII
Base Base codes, save to
Convers history, update
ion Excel, save into
history, return to
main menu.
EN-9 Empty "" Print "Target base Evidence Pass
Base Input must be a valid
integer." and
reprompt.
EN-10 Invalid "10" Print "Target base Evidence Pass
Base 1 must be one of 2, 4,
8, 16, or 32." and
reprompt.
EN-11 Invalid "abc" Print "Target base Evidence Pass
Base 2 must be a valid
integer." and
reprompt.
EN-12 Encodin Valid Key "10" Perform XOR, print Evidence Pass
g Type: Value encoded result and
XOR ASCII codes, save to
Cipher history, update
Excel, save into
history, return to
main menu.
EN-13 Empty Key "" Print "Key value Evidence Pass
Input must be a valid
integer." and
reprompt.
EN-14 Invalid Key "256" Print "Key value for Evidence Pass
Value 1 XOR Cipher must be
between 0 and 255."
and reprompt.
EN-15 Invalid Key "abc" Print "Key value Evidence Pass
Value 2 must be a valid
integer." and
reprompt.
EN-16 Encodin No "12345" Perform Bitwise Evidence Pass
g Type: Parameter NOT, print encoded
Bitwise result and ASCII
NOT codes, save to
history with
parameter=0,
update Excel, save
into history, return
to main menu.
EN-17 Encodin No "12345" Perform binary Evidence Pass
g Type: parameter encoding (e.g.,
Binary convert to ASCII
Formatt codes and then to
er binary), print
encoded result and
ASCII codes, save to
history with
parameter=0,
update Excel, save
into history, return
to main menu.
Choose VH-1 View History Select Display history Evidence Pass
3: View History Display option 3 entries in format
History (while after "[Timestamp]
running - encoding
temporary operations
)
VH-2 History Open Excel Display Total History Evidence Pass
Display in File in entries so far
Excel Debug
(permane Folder
ntly)
Choose E-1 Exit Valid Exit "0" Terminate program. Evidence Pass
0: Exit Progra
m
Main MM-1 Invalid Empty "" Reprompt Selection Evidence Pass
Menu Menu Input Choice
Input Choice
MM-2 Invalid "4" Reprompt Selection Evidence Pass
Option 1 Choice
MM-3 Invalid "abc" Reprompt Selection Evidence Pass
Option 2 ChoiceHE

3. Winform Test Case


Since the WinForms version of the String Encoding program reuses the logic from the
Encoder program but is implemented as a WinForms UI, the test case table below will
focus on testing UI-specific functionality rather than retesting the core logic (e.g., Caesar
Cipher encoding, string validation), which is assumed to be identical and already tested in
the Encoder test case table. The requirements specify testing the following UI behaviors:

Big Test TestID Test Sub Test Input Expected Evide Pass/F
Case Case Case nce ail
Choose W- Enable Select Click rbString txtInputString is Evide Pass
1: EC-1 String String enabled, nce
Encode Text Box Radio txtInputNumber is
String Button disabled,
cmbEncodingType
is enabled,
chkSortInput is
enabled.
W- Enable Check Click rbString, txtSortedInput Evide Pass
EC-2 Sort Sort enter "HELLO" in displays nce
Checkbox txtInputString, "EHLLLO",
check chkSortInput
chkSortInput remains checked,
UI remains
responsive.
W- Uncheck Click rbString, txtSortedInput is Evide Pass
EC-3 Sort enter "HELLO" in cleared, nce
Checkbox txtInputString, txtInputString
check then shows original
uncheck "HELLO",
chkSortInput
chkSortInput is
unchecked.
W- Fill Populate Click rbString cmbEncodingType Evide Pass
EC-4 Encodin Encoding contains ["None", nce
g Option Dropdown "Caesar Cipher",
"XOR Cipher",
"Reverse Text",
"Atbash Cipher"],
defaults to "None".
W- Encodin Enable Click rbString, txtShiftValue and Evide Pass
EC-5 g Type: Shift Value select "Caesar lblShiftValue are nce
Caesar TextBox Cipher" in enabled,
cmbEncodingTyp txtKeyValue,
e txtTargetBase,
txtWidth remain
disabled,
[Link]
is "Shift Value".
W- Encodin Select Click rbString, txtKeyValue and Evide Pass
EC-6 g Other XOR select "XOR lblKeyValue are nce
Type Cipher Cipher" in enabled,
cmbEncodingTyp txtShiftValue,
e txtTargetBase,
txtWidth remain
disabled,
[Link] is
"Key".
W- Select Click rbString, No parameter Evide Pass
EC-7 Reverse select "Reverse textboxes enabled nce
Text Text" in (txtShiftValue,
cmbEncodingTyp txtKeyValue,
e txtTargetBase,
txtWidth
disabled).
W- Select Click rbString, No parameter Evide Pass
EC-8 Atbash select "Atbash textboxes enabled nce
Cipher Cipher" in (txtShiftValue,
cmbEncodingTyp txtKeyValue,
e txtTargetBase,
txtWidth
disabled).
Choose W- Enable Select Click rbNumber txtInputNumber is Evide Pass
2: EN-1 Number Number enabled, nce
Encode Text Box Radio txtInputString is
Number Button disabled,
cmbEncodingType
is enabled,
chkSortInput is
disabled and
unchecked,
txtSortedInput is
cleared.
W- Fill Populate Click rbNumber cmbEncodingType Evide Pass
EN-2 Encodin Encoding contains ["None", nce
g Option Dropdown "Base
Conversion", "XOR
Cipher", "Bitwise
NOT", "Binary
Formatter"],
defaults to "None".
W- Encodin Select Click rbNumber, txtTargetBase and Evide Pass
EN-3 g Type Base select "Base lblTargetBase are nce
Paramet Conversio Conversion" in enabled,
ers n cmbEncodingTyp txtShiftValue,
e txtKeyValue,
txtWidth remain
disabled,
[Link]
is "Target Base
(2,4,8,16,32)".
W- Select Click rbNumber, txtKeyValue and Evide Pass
EN-4 XOR select "XOR lblKeyValue are nce
Cipher Cipher" in enabled,
cmbEncodingTyp txtShiftValue,
e txtTargetBase,
txtWidth remain
disabled,
[Link] is
"Key".
W- Select Click rbNumber, No parameter Evide Pass
EN-5 Bitwise select "Bitwise textboxes enabled nce
NOT NOT" in (txtShiftValue,
cmbEncodingTyp txtKeyValue,
e txtTargetBase,
txtWidth
disabled).
W- Select Click rbNumber, txtWidth and Evide Pass
EN-6 Binary select "Binary lblWidth are nce
Formatter Formatter" in enabled,
cmbEncodingTyp txtShiftValue,
e txtKeyValue,
txtTargetBase
remain disabled,
[Link] is
"Width (default 8)".
Click on W- Invalid Empty Click rbString, MessageBox: Evide Pass
Generate CL-1 Input String leave "Input cannot be nce
Button Message Input txtInputString empty.",
Box empty, select txtInputString
Work "Caesar Cipher", remains focused.
click btnGenerate
W- Invalid Click rbString, MessageBox: Evide Pass
CL-2 String enter "hello" in "String input must nce
Input txtInputString, contain only
select "Caesar uppercase letters
Cipher", click (A–Z).",
btnGenerate txtInputString
remains focused.
W- Empty Click rbNumber, MessageBox: Evide Pass
CL-3 Number leave "Input cannot be nce
Input txtInputNumber empty.",
empty, select txtInputNumber
"Base remains focused.
Conversion", click
btnGenerate
W- Invalid Click rbNumber, MessageBox: Evide Pass
CL-4 Number enter "12.34" in "Input must be a nce
Input txtInputNumber, valid integer.",
select "Base txtInputNumber
Conversion", click remains focused.
btnGenerate
W- Invalid Click rbString, MessageBox: Evide Pass
CL-5 Shift Value enter "HELLO" in "Shift value must nce
txtInputString, be an integer
select "Caesar between -25 and
Cipher", enter 25.", txtShiftValue
"26" in remains focused.
txtShiftValue,
click btnGenerate
W- Invalid Click rbNumber, MessageBox: Evide Pass
CL-6 Base enter "12345" in "Target base must nce
Value txtInputNumber, be one of 2, 4, 8,
select "Base 16, or 32.",
Conversion", txtTargetBase
enter "10" in remains focused.
txtTargetBase,
click btnGenerate
W- Display Valid Click rbString, txtOutput displays Evide Pass
CL-7 Result String enter "HELLO" in "MJQQT", nce
Work Encoding txtInputString, txtAsciiInput
select "Caesar displays "72 69 76
Cipher", enter "5" 76 79",
in txtShiftValue, txtAsciiOutput
click btnGenerate displays "77 74 81
81 84", UI remains
ready.
W- Valid Click rbString, txtOutput displays Evide Pass
CL-8 String enter "HELLO" in "JMQQT", nce
Encoding txtInputString, txtAsciiInput
with Sort check displays "72 69 76
checked chkSortInput, 76 79",
select "Caesar txtAsciiOutput
Cipher", enter "5" displays "74 77 81
in txtShiftValue, 81 84", UI remains
click btnGenerate ready.
W- Valid Click rbNumber, txtOutput displays Evide Pass
CL-9 Number enter "12345" in "3039", nce
Encoding txtInputNumber, txtAsciiInput
select "Base displays "49 50 51
Conversion", 52 53",
enter "16" in txtAsciiOutput
txtTargetBase, displays "51 48 51
click btnGenerate 57" , UI remains
ready.

5. Future Development:
Future enhancements of the Encoder Program aim to significantly expand both
functionality and user experience. A key improvement would be integrating a database to
persistently store encoding history, enabling users to search for specific past entries
quickly and reliably. Additionally, the UI could be transformed into a more interactive,
modular environment where users can drag and drop blocks representing different
encoding types, chaining them together to apply multiple transformations in sequence.
This visual flow-based approach would not only offer greater flexibility but also make
complex encoding operations more intuitive and customizable. These developments would
elevate the application from a simple utility to a powerful and extensible encoding
platform.

6. Appendix
1. Encoder
1.1. SaveHistoryCode
1.2. ProcessStringEncoding
1.3. ProcessNumberEncoding
2. TestCase Evidence
2.1. String Processing
2.1.1. Test Case Input String
[Link]. Input String - Valid Input 1
[Link]. Input String – Valid Input 2

[Link]. Invalid String Input (Empty Input, Special Characters, Digits in Input,
Non-Capital Letters, Exceeds 40 Characters)

2.1.2. Test Case Input Shift Value


[Link]. Invalid Shift Input (Empty Shift Input, Non-Integer Shift Input, Shift
Outside Boundary)
2.1.3. Test Case Encoding Output
[Link]. Encoding Output – Valid Encoding with Input HELLO, Shift 5

[Link]. Encoding Output – Valid Encoding with Input , Shift -5

2.2. Encoder
2.2.1. Invalid Menu Choice
2.2.2. Encode String
[Link]. Invalid Input

[Link]. Valid Input


[Link].1. Empty Input, Invalid Response
[Link].2. Valid yes/no
1. If Yes

2. If No

(continue test 1)
[Link]. Encoding Type
[Link].1. Empty choice, Invalid choice

[Link]. Caesar Cipher


[Link].1. Empty Shift, Invalid Shift Value
[Link].2. Valid Shift Value

[Link]. XOR Cipher


[Link].1. Empty Key, Invalid Key Input

[Link].2. Valid Key

[Link]. Reverse Text


[Link]. AtbashCipher

2.2.3. Encode Number


[Link]. Invalid Input
[Link]. Valid Input

[Link]. Encoding Type


[Link].1. Empty choice, Invalid choice
[Link]. Base Conversion
[Link].1. Empty Base, Invalid Base Input

[Link].2. Valid Base Value

[Link]. XOR Cipher


[Link].1. Empty Key, Invalid Key Value
[Link].2. Valid Key

[Link]. Bitwise NOT

[Link]. Binary Formatter

2.2.4. View History


[Link]. History Display
[Link]. History In Excel

2.2.5. Choose 0 -> Exit program

2.3. Winform
2.3.1. Encode String
[Link]. Enable String TextBox, Enable Sort, Fill Encoding Option
[Link]. Select Encoding Type Caesar Cipher

[Link]. Select Encoding Type XOR Cipher

[Link]. Select Encoding Type Reverse Text


[Link]. Select Atbash Cipher
2.3.2. Encode Number
[Link]. Enable Number TextBox, Fill Encoding Number Option

[Link]. Select Encoding Type


[Link].1. Select Base Conversion
[Link].2. Select XOR Cipher

[Link].3. Select BitWiseNot


[Link].4. Select BinaryFormatter

2.3.3. Click on Generate Button


[Link]. Empty String Input
[Link]. Invalid String Input
[Link]. Empty Number Input
[Link]. Invalid Number Input
[Link]. Invalid Shift Value
[Link]. Invalid Base Value

[Link]. Invalid Key Value


[Link]. Valid String Encoding

[Link]. Valid String Encoding with sort


[Link]. Valid Number Encoding

You might also like