SRS-file Raid
SRS-file Raid
Specification
for
Copyright © 1999 by Karl E. Wiegers and 2018 by Sam Siewert. Permission is granted to use, modify, and
distribute this document.
Software Requirements Specification for Linux File RAID Page ii
Table of Contents
Table of Contents .......................................................................................................................... ii
Revision History ........................................................................................................................... iii
1. Introduction ..............................................................................................................................1
1.1 Purpose ........................................................................................................................................ 1
1.2 Document Conventions ............................................................................................................... 1
1.3 Intended Audience and Reading Suggestions ............................................................................. 2
1.4 Product Scope .............................................................................................................................. 2
1.5 References ................................................................................................................................... 3
2. Overall Description ..................................................................................................................3
2.1 Product Perspective ..................................................................................................................... 3
2.2 Product Functions ........................................................................................................................ 7
2.3 Use Cases .................................................................................................................................... 9
2.4 Use Case and Requirements Tracing......................................................................................... 10
2.5 Operating Environment ............................................................................................................. 10
2.6 Design and Implementation Constraints ................................................................................... 11
2.7 User Documentation .................................................................................................................. 11
2.8 Assumptions and Dependencies ................................................................................................ 11
3. External Interface Requirements .........................................................................................12
3.1 User Interfaces ........................................................................................................................... 12
3.2 Hardware Interfaces .................................................................................................................. 12
3.3 Software Interfaces .................................................................................................................... 12
3.4 Communications Interfaces ....................................................................................................... 12
4. System Features......................................................................................................................12
4.1 System Feature 1 ....................................................................................................................... 13
4.2 System Feature 2 (and so on) … ............................................................................................... 13
5. Test Driven Design Reference Prototypes ...........................................................................13
5.1 Checkout and build .................................................................................................................... 14
5.2 Running Unit tests ..................................................................................................................... 16
5.3 Path coverage............................................................................................................................. 18
5.4 Profiling ..................................................................................................................................... 19
5.5 I&T scripts ................................................................................................................................. 19
5.6 System tests and scripts ............................................................................................................. 21
5.7 Regression tests and scripts ....................................................................................................... 22
5.8 Acceptance tests ........................................................................................................................ 25
6. Other Nonfunctional Requirements .....................................................................................26
6.1 Performance Requirements ....................................................................................................... 26
6.2 Safety Requirements.................................................................................................................. 26
6.3 Security Requirements .............................................................................................................. 27
6.4 Software Quality Attributes ...................................................................................................... 27
6.5 Business Rules ........................................................................................................................... 27
7. Other Requirements ..............................................................................................................28
Appendix A: Glossary..................................................................................................................28
Appendix B: Analysis Models .....................................................................................................28
Appendix C: To Be Determined List ..........................................................................................29
Software Requirements Specification for Linux File RAID Page iii
Revision History
Name Date Reason For Changes Version
Sam Siewert 2/19/2018 Initial creation or draft to provide documentation for 1.0
prototype.
Software Requirements Specification for Linux File RAID Page 1
1. Introduction
Note that this reference design included reference prototype code, which can be obtained from an
non-managed source for convenience as noted in the text below, but the ideal place to obtain the
latest reference code corresponding to this documentation is github
(https://github.com/siewertserau/Examples-RAID-Unit-Test ). I will make every attempt to keep
the code and documentation in reasonable synchronization, but it is up to the reader and the
software engineer re-using this example to “make it their own”. If you want to check in
improvements, you can request to be added to my github, but otherwise the intent is for you to clone
as a starting point and fork your own project including documentation, analysis, design, and code
files.
1.1 Purpose
This SRS provides an overall specification for a Linux File RAID version 1.x.x (Redundant Array of
Inexpensive Disk) library of operations as well as example application that can be used to create
storage as a service, similar to commercial products such as Google drive, MS One drive, AWS
S3, or Dropbox. This specification and the associated software is not intended to be a product or
Cloud service, but serves as a pedagogical example of how to analyze, design and build software
like these products, starting with the data storage and protection services, to which students can
add features such as web access, security, user friendliness (e.g. browsing), and a wide range of
additional features to create their own STaaS (Storage as a Service) application. File level RAID
was selected rather than block storage DAS (Direct Attach Storage) or SAN (Storage Area
Networking) for simplicity and portability so that a derived STaaS application can be hosted almost
anywhere on an platform file system. The Linux File RAID software is composed of a library of
RAID write (encode), read (decode), rebuild (reconstruction of lost or corrupted file chunk) and
basic data compare functions, a file storage and retrieval system with data protection, and unit test
code for the library along with basic system testing for the file RAID application. The library code
is intended to be re-useable (perhaps with modification and extension) for use in new file RAID
applications for new platforms or to provide new STaaS with a web interface. The goal is to
support learning objectives related to software analysis, architecture, design, and implementation
quality assurance along with testing examples at the unit, I&T (Integration and Test), system, and
acceptance testing levels.
In this document, UML analysis and design methods are used, where requirements must correlate
to use cases, which have hierarchy and priority. Thus, the requirements are prioritized and placed
into hierarchy based upon UML use case hierarchy and priority analysis. This is consistent with
principles learned in SE 300 (SA/SD - Structured Analysis and Design), SE 310 (Object Oriented
Analysis - OOA, OO Design - OOD, OO Programming - OOP) and SE 420 (Software Quality
Assurance).
Software Requirements Specification for Linux File RAID Page 2
Overall, the SRS is intended to provide a reasonably complete specification of the example Linux
File RAID software at the level of a working example that can be improved by students for
practice and as a starting point if they wish for a more complete STaaS final project.
Specific objectives include learning objectives related to each phase of the “V” model, with an Agile
evolutionary approach to analysis, design, development and test. Specficially, it is assumed that
rather than strict waterfall phases of development, students will make quick two week sprints
through phases of analysis, design, and implementation with a test-driven design approach
(consideration of testing first or at least concurrent with design).
By the time a student is done reviewing and improving this reference SRS and associated
software at the unit level (CSU – Computer Software Unit) and test application (CSCI – Computer
Software Configuration Item) level, they should have a good working knowledge of test-driven
evolutionary software development. This can also be a starting point for a longer term project or
Software Requirements Specification for Linux File RAID Page 3
even a capstone design project to build an entire system service (e.g. STaaS) or platform hosted
application suitable for deployment.
1.5 References
1. https://www.dau.mil/glossary/Pages/Default.aspx
2. International Organization for Standardization/International Electrotechnical
Commission/Institute of Electrical and Electronics Engineers (ISO/IEC/IEEE) Standard
24765:2010: Systems and Software Engineering – Vocabulary
3. https://www.computer.org/web/swebok/v3, Bourque, Pierre, and Richard E. Fairley. Guide
to the software engineering body of knowledge (SWEBOK (R)): Version 3.0. IEEE
Computer Society Press, 2014.
4. http://agilemanifesto.org/
5. https://www.omg.org/spec/UML/2.5.1/, UML 2.5.x specification
6. Kendall, Penny A. Introduction to systems analysis and design: a structured approach.
Business & Educational Technologies, 1995.
7. Rumbaugh, James, Ivar Jacobson, and Grady Booch. Unified modeling language reference
manual, the. Pearson Higher Education, 2004.
8. https://raid.wiki.kernel.org/index.php/RAID_setup, Linux software RAID using MDADM.
9. Welch, Brent, et al. "Scalable Performance of the Panasas Parallel File System." FAST. Vol.
8. 2008.
10.Libes, Don. Exploring Expect: a Tcl-based toolkit for automating interactive programs. "
O'Reilly Media, Inc.", 1995.
2. Overall Description
For students, it is not practical to expect them to have access to SAS/SATA (Serial Attached SCSI
or Serial Attached ATA) disk array with root access on a Linux system, so the Linux File RAID
allows them to learn about RAID and at the same time learn about software system (service) and
Software Requirements Specification for Linux File RAID Page 4
application analysis, design, implementation and test. Students wishing to compare block RAID to
file RAID may want to consult Linux MDADM (Multi-Disk Administration) and examples of use with
RAM (Random Access Memory) disks for tutorials on configuration, use and operation of software
RAID without dedicated HDD arrays. The Linux File RAID is mostly for learning and practice with
RAID, but could be used in an actual deployment as long as each file chunk is mapped to a unique
file system.
RAID has levels including striping (level 0), mirroring (level 1) and XOR parity (level 5) as well as
double XOR parity (level 6). These levels can be combined so that unique block devices are
striped and mirrored (level 10 or sometimes called 0+1) or striping of XOR parity sets (level 50).
Furthermore, the number of independent disks (or file systems) is variable, but normally ranges
from the minimum of a mirror pair (two disks or file systems) up to any number of three or more for
XOR parity schemes. The fundamentals of RAID systems are covered in CS 317, file and
database systems, and many excellent references and examples such as Linux block level
software RAID (MDADM). The same principles used to map blocks (typically 512 bytes of data at
a time up to 4 kilobytes) onto a set of independent HDD or SSD storage devices can also be used
to break a large file up into file chunks (sub-files) that can be mapped onto multiple independent
file systems. The block level is the most common RAID system type where a file system is then
built on top of this new RAID volume (virtual block storage device). However, file level is used in
real products (e.g. Panasas - https://www.panasas.com/ ) and serves as a convenient alternative
to dealing with low-level block devices. All of the same data protection can be achieved as long as
file chunks are mapped to independent file systems rather than independent storage devices. This
approach is actually taken for scale-out file systems (federated file systems) and is an alternative
to SAN (Storage Area Networking) and can work with NAS (Network Attached Storage) or be used
as a NAS alternative. It is potentially a great way to provide STaaS (Storage as a Service) where
the main goal is to provide a “bit bucket” to share files, back them up, or provide a web based
distribution for files. Figure 1 shows a basic RAID 10, where mirror pair block level storage
devices (HDD or SSD) are striped.
The idea behind RAID-10 is to provide speed-up for reads and writes by using multiple disk drives
in parallel to read portions of a larger set of blocks composing a file or other storage object and at
the same time, mirror blocks onto multiple independent disk drives in case one fails. If one does
fail, a data erasure, the lost data can simply be read from any device that mirrors the same data.
When the failed disk drive is replaced by a disk array technician, the system can restore the
mirroring automatically. So, RAID has two main system level design goals – speedup by writing
large data sets to many disks in parallel by chunking the original data into blocks as well as
providing protection against data loss due to temporary device malfunction or failure. The key to
RAID is that the blocks (or more generally chunks) of data must be allocated (mapped) to
independent devices or file systems to provide actual speed-up and data loss protection when
devices (or file sub-systems) fail. In order to simply learn about RAID and practice with the
operations, actual independent devices are not required, but not speed-up and no failure fault-
tolerance will actually be realized – for example if file RAID is used with just one file system rather
than multiple independent. However, not only can one learn about RAID, the basic features and
functions can still be tested, and when a system with “n” file systems or “n” devices is available,
then the speed-up and failure fault tolerance can likewise be tested (performance constraints and
error recovery requirements). Figure 2 shows a basic RAID 50, where XOR parity block level
storage devices are striped.
Figure 2. Striping of data blocks over two 4+1 distributed parity RAID-5 sets
Software Requirements Specification for Linux File RAID Page 6
For RAID-50, RAID-5 sets are striped and each RAID-5 set of devices can in fact be any number
of devices as long as each set is one parity plus at least one or more data devices – typically n+1
(5 shown here). While it’s possible to make one of the devices a dedicated parity device, most
often the parity is distributed, and parity for any particular write set (n blocks or chunks) must
simply be placed on an independent device (+1 device) so that any missing block can be
recovered by re-computing the parity of the remaining blocks.
Due to ability to emulate and test a wide range of RAID configurations with file RAID, the design
does not provide any block level RAID capability, only file chunk RAID. This supports learning
objectives better by allowing students to run code on any Linux system (and easily port the
solution to a wide range of POSIX compliant systems such as Mac OS-X, Free BSD, etc.)
To simplify and allow for experimentation with RAID anywhere, the Linux File RAID simply models
each independent storage chunk in a RAID mapping as a sub-file that composes a larger file as
shown in Figure 3.
Test requirements:
1. Show that any chunk, A, B, C, D or XOR can be deleted or corrupted and recovered
2. Show that any file size up to constraint size can be written and stored
3. Show that read and recovery results in an identical file to that written by full data compare
or a data digest
4. Test basic number of RAID writes per second possible
5. Test basic number of RAID reads per second possible
6. Test immediate read-after-write RAID operations possible with our without data compare
System constraints:
1. Storage of files up to 1 gigabyte in size (e.g. typical documents, image files, code, text,
binary files)
2. RAID operations of 100 K read/write operations per second or better in the library such that
a 1 gigabyte file could be written at a rate of 50 kilobytes/second or better, completing file
transfer of a megabyte in 20 seconds or less
Software Requirements Specification for Linux File RAID Page 8
3. The current prototype can only handle files, not directories of multiple files, but this could
be an extension pursued for a project or feature addition exercise which would require
management of namespace metadata.
4. The current prototype does not implement any file access control or authentication, but this
could be pursued as a feature addition exercise or project.
Figure 4 shows a basic class diagram for file RAID. This model can be found as a working
example as a UML model for Modelio -
http://mercury.pr.erau.edu/~siewerts/se310/design/Modelio/3.4-SD/
Figure 4. More fully featured class diagram for Linux File RAID STaaS or Application
Note that Figure 4 shows class attributes and associations that go beyond what the current
prototype has implemented such as:
A significant, but useful feature that could be added is journaling, whereby all versions of the same
file (same name and path) could be preserved at a chunk level (which therefore works for any file
type including binary as well as text) where only modified chunks are re-written on update. This is
a complex feature, but many file systems and RAID systems do provide this journaling feature by
comparing chunks and writing all changed chunks with time and date metadata. One major
Software Requirements Specification for Linux File RAID Page 9
challenge of journaling are the potential read-modify-write operations (and associated workload)
for this feature.
For STaaS, it is assumed that users will mostly want a basic archiving capability for files to be
used for backup, file sharing, and file distribution. Common uses would be storing, sharing and
distributing digital photos, design files, or other file types other than code. Code is most often best
stored in a CMVC system, so while source code files could be stored, the system provides no
specific advantage and is intended to mostly provide a bit bucket for files.
For a local Linux File RAID browser and data protection application, the user will want the file
system to be as easy to use as current command line directory manipulation tools and graphical
file explorers commonly available on Ubuntu. Basic access control (user, group and other
permissions) and user authentication should be supported.
The key advantage of the Linux File RAID STaaS and browser are the built in speedup and data
protection features, which may be sufficient to make the service and applications built for
deployment using this software design advantageous compared to block level software RAID
(easier to use on a directory basis rather than volume of disks in array). However, additional
Software Requirements Specification for Linux File RAID Page 10
features such as journaling, directory level authentication, web access to Linux File RAID and
other feature extensions possible could increase value and advantages for users. These use
cases could be broken into smaller more specific use cases and expanded based upon the
intended application of STaaS or a local browser.
This should be completed as a validation of requirements – are the right requirements and use cases
driving what is built so that we build the right thing. Whether the design has been built right
(verification) can be determined by steps such as code generation from CASE (Computer Aided
Software Engineering) tool code generation (e.g. Modelio class C++ generation, MySQL
Workbench schema SQL generation, etc.) as well as prototyping, design walk-throughs, and code
walk-throughs along with SQA test plans, scripts, and drivers outlined in section 5 for test-driven
design with prototyping.
The design and prototype software should build and run on most any Linux system, without need
for root access, but can only be used as a safe deployment with a multi-file scalable system and is
primarily intended for educational exploration of Linux File RAID rather than actual deployment.
For RDBMS metadata management the software should be run on a system with MySQL or other
commonly available RDBMS that can be accessed locally by the software, ideally with dedicated
storage independent of the file systems used to store the chunked file RAID data and parity.
Software Requirements Specification for Linux File RAID Page 12
A simple command line interface could be created using a shell such as this mini-shell application
code (http://mercury.pr.erau.edu/~siewerts/cs415/code/minishell/ ), or with a GUI built with Qt
creator or another similar 2D GUI development tool chain.
The interactive CLI (Command Line Interface) and/or browser GUI (Graphical User Interface) are
left as an exercise for the student to explore for practice and/or a project.
4. System Features
The current software is a simple library and example that students are expected to extend into a
web service for STaaS or an application for a file RAID browser. As such, the template for
detailed features and requirements that follows have been left in the original SWEBOK template
format.
Software Requirements Specification for Linux File RAID Page 13
<This template illustrates organizing the functional requirements for the product by system
features, the major services provided by the product. You may prefer to organize this section by
use case, mode of operation, user class, object class, functional hierarchy, or combinations of
these, whatever makes the most logical sense for your product.>
REQ-1:
REQ-2:
If the raid_regression.sh script is not “green” indicated it is executable, you can make it so with
chmod a+x raid_regression.sh as sometimes github cloning with your local “umask”
can wind up modifying file attribute bits such as execute privilege. See associated Linux manual
pages for more information (e.g. umask, chmod).
Now build the examples with “make” using make. If you are new to development and building
software in Linux, you may find some of Dr. Siewert’s tutorials useful
(http://mercury.pr.erau.edu/~siewerts/se420/documents/Linux/ ), especially Makefile Basics for
Linux. All code delivered for SQA should build with a simple top-level “make” and ideally should
be warning free when “-Wall” is used. If that’s not true, that should be noted as a build issue.
Normally warnings are not considered a build failure, but can indicate code problems that could
negatively impact execution tests. The developer should therefore be asked to make code fixes to
silence warnings and/or provide expalanation and specific build warning options is some warnings
can’t be fixed (suppressing warnings can be a dangerous practice, so first preference is fixing code
and maintaining –Wall if at all possible).
Figure 7 below shows a make build of the reference code which at the point in time when this code
was cloned, was warning free with “-Wall” as can be seen below. Checking warnings may also be
supported by code walk-throughs to ensure that they have been properly addressed.
Software Requirements Specification for Linux File RAID Page 15
After a successful build, this should be noted (either autmatically by a regression script or by the QA
tester in a notebook or test plan). As can be seen by the executable scripts and test drivers in
“green”, there are eight total tests at the time of the last update of this document. These tests can be
described as follows in Table 1.
The main point of these three tests is that they all provide the same visual verification of
correctness for XOR encoding, rebuild of the fourth block, and then testing with generated patterns
using a modulo function for 1000 test cases (or more if provided as an argument) to pattern test
the XOR encode and rebuild. This was used to simply ensure first that the XOR and rebuild
operations were correct and also to make sure that the 64-bit variant and array variant agree with
the original test. For simple visual verification a specific pattern is used in a repeating sequence
as follows:
ASCII - #0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ#
HEX - 3a 47 48 49 4a 4b 4c 4d 4e 4f 50 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25
26 27 28 29 2a 2b 2c 2d 58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 0 1 2 3 4 5 6 7 8 9 a b c d 3a
The second set of test cases uses a new set of patterns and offsets into an array of logical block
addresses for chunk data. An assert is called for each test based on a full memory compare
difference test, so any difference in the rebuilt buffer from original will cause the test to assert.
The next set of unit tests compares the simple byte array formulation for XOR with pointers and
array dereference to determine if both can meet performance constraints. The question we want
to asnwer is whether there is a signficant performance different between use of pointers compared
to array dereferencing (seen as easier to read and understand) and it appears there is no
appreciable difference for 1,000,000 operations of XOR encode and XOR to rebuild a chunk.
Whereas there is no apparent difference between byte arrays and byte poitners, there is a huge
performance difference for the 64-bit version on VB-Linux:
Software Requirements Specification for Linux File RAID Page 17
Which is approximately 6x faster without optimization and without vector instruction code
generation (significant).
However, if we recompile both with level 3 optimization and SSE vector instruction code
generation, for the first raid_perftest UNIT test, we get:
Where arrays are actually 50% faster than pointers (good for readability and performance) and
compared to 64-bit, arrays are still the fastest with optimization on:
If this is a critical performance constraint, we’d want to test the different formulations on platforms
that are of most intests such as the STaaS workstation we plan to use.
As a final white-box unit test, the McCabe metric is run on radilib.c to rank functions in terms of
functional complexity, resulting in:
Software Requirements Specification for Linux File RAID Page 18
Which indicates that stripeFile and restoreFile are the most complex in terms of code structure, so
they might be best to walk-through to see if there are simplifications (or single step through with a
debugger). The point would be restructuring of the logic and/or algorithm for speed-up, readability,
and maintainability (none are functional requirements, but performance is an important constraint
or minimum requirement).
Another white-box test might examine the assembly code generated for key code blocks that are
performance critical, although performance is well above the constraint (minimum requirement) or
50K operations per second.
Development of additional unit test cases (corner cases, stress, soak, random pattern, complexity
analysis, etc.) are left up to the student.
Furthermore, when compiled, the –lgcov linking directive must be added to link the gcov library
with the executable as well.
Note that the coverage data can also be converted into a browseable web page. This is done after
building and running with gcov instrumentation using commands to create HTML from the statistics
with:
Which will produce the browseable coverage similar to that generated for enigma3 in the above
example - http://mercury.pr.erau.edu/~siewerts/se420/code/Enigma-LCOV-results/
Software Requirements Specification for Linux File RAID Page 19
The gcov and lcov analysis is left as an exercise for the student to complete based upon the example
provided for enigma3.c code. Emphasis should be on raidlib.c for this code.
5.4 Profiling
Gnu profiling using gprof can be completed as follows by simply adding –pg to the compile options
that are normally used, so:
%make
cc -O3 -Wall -pg -msse3 -malign-double -g -c raidtest.c
raidtest.c: In function 'main':
cc -O3 -Wall -pg -msse3 -malign-double -g -c raidlib.c
cc -O3 -Wall -pg -msse3 -malign-double -g -o raidtest raidtest.o
raidlib.o
%./raidtest
Will default to 1000 iterations
Architecture validation:
sizeof(unsigned long long)=8
RAID Operations Performance Test
Test Done in 453 microsecs for 1000 iterations
2207505.518764 RAID ops computed per second
%ls
Makefile gmon.out raidlib.h raidlib64.c raidtest raidtest.o
Makefile64 raidlib.c raidlib.o raidlib64.h raidtest.c raidtest64
%gprof raidtest gmon.out > raidtest_analysis.txt
This profile shows that most of the time is spent in “main” for raidtest (which is not surprising as
memory copies and memory comparison are very costly) followed by XOR encoding and then
rebuild.
Flat profile:
Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls ns/call ns/call name
82.13 1.54 1.54 main
15.47 1.83 0.29 2000001 145.38 145.38 xorLBA
2.67 1.88 0.05 2000001 25.07 25.07 rebuildLBA
This should be retested with profiling for specific critical performance constraints for STaaS or
Linux File RAID browser functionality. A key aspect is to make sure that enough iterations are
executed to achieve a ramped-up stable performance metric.
application that approximates Linux File RAID as an application. To run the stripetest, simply
provide an input file to encode into 5 chunks including 4 data and 1 XOR as follows:
siewerts@sam-ubuntu-VirtualBox:~/se420/Examples-RAID-Unit-Test$
./stripetest
Usage: stripetest <inputfile> <outputfile>
siewerts@sam-ubuntu-VirtualBox:~/se420/Examples-RAID-Unit-Test$
./stripetest Baby-Musk-Ox.ppm Baby-Musk-Ox.ppm.restored
read full stripe
…
read full stripe
hit end of file
CHUNKED with bytesWritten=756954
FINISHED with bytesRestored=756954
siewerts@sam-ubuntu-VirtualBox:~/se420/Examples-RAID-Unit-Test$
Upon completion, to ensure that the I&T driver in fact successfully created a restored version of
the original file, a binary difference should be checked. First, we can simply difference the two
files as follows:
Both are simply silent if there are no differences as is true above, which can be unsatisfying, so to
verify more rigorously, we might want to review and make sure there are no differences visually.
This can be done by converting the binary into hexidecimal files (which will be much larger) and
reviewing visually and peforming a diff on the ASCII hexidecimal files as follows:
Software Requirements Specification for Linux File RAID Page 21
For a more visual review, try “vbindiff” which can be installed with “sudo apt-get install vbindiff”,
which produces a review that shows that there are no differences and allows you to hit
<RETURN> to skip to any binary difference sections (if there are any).
Which doesn’t appear to have done much, but we find that this test builds a log file (common with
regression for a large batch of smaller github updates, clean and build, test driver executions,
scripts, etc. all in one run). The log file shows:
siewerts@sam-ubuntu-VirtualBox:~/se420/Examples-RAID-Unit-Test$ cat
testresults.log
RAID UNIT REGRESSSION TEST
TEST SET 2: simple RAID encode, erase and rebuild test Successful RAID
Will start 1000 test iterations write, read, erase
Architecture validation: and rebuild, etc.
sizeof(unsigned long long)=8
TEST CASE 1:
3a 47 48 49 4a 4b 4c 4d 4e 4f 50 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20
21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 58 59 5a 5b 5c 5d 5e 5f 60 61 62
63 0 1 2 3 4 5 6 7 8 9 a b c d 3a 3a 47 48 49 4a 4b 4c 4d 4e 4f 50 14 15
16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d
58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 0 1 2 3 4 5 6 7 8 9 a b c d 3a 3a 47
48 49 4a 4b 4c 4d 4e 4f 50 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22
23 24 25 26 27 28 29 2a 2b 2c 2d 58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 0 1
2 3 4 5 6 7 8 9 a b c d 3a 3a 47 48 49 4a 4b 4c 4d 4e 4f 50 14 15 16 17
18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 58 59
5a 5b 5c 5d 5e 5f 60 61 62 63 0 1 2 3 4 5 6 7 8 9 a b c d 3a 3a 47 48 49
4a 4b 4c 4d 4e 4f 50 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24
25 26 27 28 29 2a 2b 2c 2d 58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 0 1 2 3 4
5 6 7 8 9 a b c d 3a 3a 47 48 49 4a 4b 4c 4d 4e 4f 50 14 15 16 17 18 19
1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 58 59 5a 5b
5c 5d 5e 5f 60 61 62 63 0 1 2 3 4 5 6 7 8 9 a b c d 3a 3a 47 48 49 4a 4b
4c 4d 4e 4f 50 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26
27 28 29 2a 2b 2c 2d 58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 0 1 2 3 4 5 6 7
8 9 a b c d 3a 3a 47 48 49 4a 4b 4c 4d 4e 4f 50 14 15 16 17 18 19 1a 1b
1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 58 59 5a 5b 5c 5d
5e 5f 60 61 62 63 0 1 2 3 4 5 6 7 8 9 a b c d 3a
3a 47 48 49 4a 4b 4c 4d 4e 4f 50 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20
21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 58 59 5a 5b 5c 5d 5e 5f 60 61 62
63 0 1 2 3 4 5 6 7 8 9 a b c d 3a 3a 47 48 49 4a 4b 4c 4d 4e 4f 50 14 15
16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d
58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 0 1 2 3 4 5 6 7 8 9 a b c d 3a 3a 47
48 49 4a 4b 4c 4d 4e 4f 50 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22
23 24 25 26 27 28 29 2a 2b 2c 2d 58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 0 1
2 3 4 5 6 7 8 9 a b c d 3a 3a 47 48 49 4a 4b 4c 4d 4e 4f 50 14 15 16 17
18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 58 59
Software Requirements Specification for Linux File RAID Page 24
5a 5b 5c 5d 5e 5f 60 61 62 63 0 1 2 3 4 5 6 7 8 9 a b c d 3a 3a 47 48 49
4a 4b 4c 4d 4e 4f 50 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24
25 26 27 28 29 2a 2b 2c 2d 58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 0 1 2 3 4
5 6 7 8 9 a b c d 3a 3a 47 48 49 4a 4b 4c 4d 4e 4f 50 14 15 16 17 18 19
1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 58 59 5a 5b
5c 5d 5e 5f 60 61 62 63 0 1 2 3 4 5 6 7 8 9 a b c d 3a 3a 47 48 49 4a 4b
4c 4d 4e 4f 50 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26
27 28 29 2a 2b 2c 2d 58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 0 1 2 3 4 5 6 7
8 9 a b c d 3a 3a 47 48 49 4a 4b 4c 4d 4e 4f 50 14 15 16 17 18 19 1a 1b
1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 58 59 5a 5b 5c 5d
5e 5f 60 61 62 63 0 1 2 3 4 5 6 7 8 9 a b c d 3a
766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783
784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801
802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819
820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837
838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855
856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873
874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891
892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909
910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927
928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945
946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963
964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981
982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999
FINISHED
TEST SET 3: REBUILD DIFF CHECK for Chunk4 rebuild Successful re-
Binary files Chunk1.bin and Chunk4_Rebuilt.bin differ build indicated by
Binary files Chunk2.bin and Chunk4_Rebuilt.bin differ zero differences
Binary files Chunk3.bin and Chunk4_Rebuilt.bin differ (silent) for
Chunk4 and
TEST SET 4: RAID performance test Chunk4 rebuilt
Will start 1000 test iterations
This functionality can be found in a number of regression automation tools including “expect” and
“dejagnu” for Linux, which can be installed if needed with:
An example “expect” script produces this type of PASS, FAIL and TIMEOUT outcome output. On
failure or timeout, one option is to run the specific test again with logging on so that the normal all
Software Requirements Specification for Linux File RAID Page 26
PASS scenario is now slowed down by logging when tests are running as expected. Either way,
when “raid_rebuild_verify.exp” is run as follows:
We see three passes as expected from running raidtest and piping the output into “expect” which
matches output specification provided in “raid_rebuild_verify.exp” and produces report summary
outcomes for each test case. To see what happens when we don’t produce any data for expect, we
run it again with nothing piped in and see timeouts for each case:
<If there are performance requirements for the product under various circumstances, state them
here and explain their rationale, to help the developers understand the intent and make suitable
design choices. Specify the timing relationships for real time systems. Make such requirements as
specific as possible. You may need to state performance requirements for individual functional
requirements or features.>
<Specify those requirements that are concerned with possible loss, damage, or harm that could
result from the use of the product. Define any safeguards or actions that must be taken, as well as
actions that must be prevented. Refer to any external policies or regulations that state safety
issues that affect the product’s design or use. Define any safety certifications that must be
satisfied.>
Software Requirements Specification for Linux File RAID Page 27
<Specify any requirements regarding security or privacy issues surrounding use of the product or
protection of the data used or created by the product. Define any user identity authentication
requirements. Refer to any external policies or regulations containing security issues that affect the
product. Define any security or privacy certifications that must be satisfied.>
1. Unit testing
a. Unit test cases for each library function (extended what is provided in the example -
http://mercury.pr.erau.edu/~siewerts/se420/code/Examples-RAID-Unit-Test/ )
b. Addition of code coverage to black box unit testing
c. Addition of code module profiling to black box performance unit tests
d. White-box unit testing as the student sees fit to refactor and improve software
source level quality including readability, modularity, maintainability, etc. and other
non-functional requirements
2. I&T testing
a. Integration of RAID operations modules into a simple application with command line
b. Combination of RAID levels including RAID-0, RAID-1, RAID-5
c. Fault injection including loss of a mirrored or XOR parity projected chunk of a file
3. System testing
a. Integration with a GUI for browsing
b. Integration with web services for remote browsing
4. Acceptance testing
a. Basic use case scenarios for a bit bucket and associated tests
5. Regression testing and scripting
a. Curation of a set of tests from unit, I&T, and system testing that can be re-run
manually or via scripted tests to regression test software after bug fixes and feature
additions.
<Specify any additional quality characteristics for the product that will be important to either the
customers or the developers. Some to consider are: adaptability, availability, correctness,
flexibility, interoperability, maintainability, portability, reliability, reusability, robustness, testability,
and usability. Write these to be specific, quantitative, and verifiable when possible. At the least,
clarify the relative preferences for various attributes, such as ease of use over ease of learning.>
1. RAID library that can be re-used, implemented in C or C++ with simple demonstrations and
unit tests including all operations required for a STaaS web service or a stand-alone
browser
2. Stand-alone file RAID browser with extended features for data protection, data privacy, and
general file security.
3. STaaS bit bucket service with data protection and data privacy features.
<List any operating principles about the product, such as which individuals or roles can perform
which functions under specific circumstances. These are not functional requirements in
themselves, but they may imply certain functional requirements to enforce the rules.>
7. Other Requirements
Rather than focus on complexity in terms of number of features, students are asked to focus on
quality of both analysis and design (SA/SD and/or OOA/OOD) as well as code quality in C or C++
(structured program or OOP implementation). For a project, students should adopt a coding
standard, for example: [Ganssle Firmware Style, EC++, Google Style Guide, Stroustrup on Style,
ROS Style Guide, Apple Kernel Style Guide, UM Style Guide]. A coding standard is not pre-
selected and enforced, but rather one should be adopted and basic styles followed and
referenced.
<Define any other requirements not covered elsewhere in the SRS. This might include database
requirements, internationalization requirements, legal requirements, reuse objectives for the
project, and so on. Add any new sections that are pertinent to the project.>
Appendix A: Glossary
RAID – Redundant Array of Independent (or Inexpensive) Disks
File – collection of bytes with a name and attributes such as last time and date of modification,
ownership, access rights, etc.
CLI – Command Line Interface
GUI – Graphical User Interface
STaaS – Storage as a Service
<Define all the terms necessary to properly interpret the SRS, including acronyms and
abbreviations. You may wish to build a separate glossary that spans multiple projects or the entire
organization, and just include terms specific to a single project in each SRS.>
<Optionally, include any pertinent analysis models, such as data flow diagrams, class diagrams,
state-transition diagrams, or entity-relationship diagrams.>
Software Requirements Specification for Linux File RAID Page 29