Software engineering

From DmWiki

Table of contents

What is software engineering

To put it as simply as possible software engineering is the methodology of creating software. More presicely, it is a methodology for creating software *and* it's accompanying documentation on time, on budget and with quality.

The three concepts of being on time, on budget or of high quality are governed by the project triangle

Software engineering usually involves using one of many different software process models to go about creating your application. All of the software process models involve different phases, and all of them are more or less this:

  • Requirements
  • Analysis
  • Design
  • Implementation
  • Testing
  • Integration
  • Maintenance
  • Copy protection

Different software methodologies

{{* RUP}}

Requirements

Software requirements is where you decide what your software is required to do, not what you are required to do. This part is generally where you client tells you something like "I want a game where you are stuck in an alien world and have to escpe the planet by killing hoards of alien monsters with different types of awsome weapons". Then you have to dissect what they are saying and flush their thoughts out as much as humanly possible. There are basically two differnet types of requirements, non-functional and functional. Functional was just mentioned above. Non-functional requirements are those requirements which have an effect on the project but are not part of the final software application. Things like how long you have to complete it, the budget you get, what is your development hardware, how many people do you have, etc...

Analysis

Here you analyze if there is any point in making the software. Is there a market for it? Is there any competition? Can you do it better then the competition? Will people swith to your software if they have your competitors software? Can I make profit?? Is it even possible to make it the way the client wants it?

Design

One word: UML. Over here you usually use UML to make a blue print of your software. The blueprint almost always has a class diagram as part of it in which you decide what classes you will need and of their relationships with each other.

Implementation

You can probably guess this one, but if you cant, it's where you build the bridge. That is actually code up your application, make the 3D models in Max/Maya, create textures in Adobe photoshop and either rip music from various soundtracks or make your own (the latter being the most taken route - unless you're an indie)

Testing

Make sure your software works properly. The degree of testing varies on the type of software, if you are making an MMO game, then you need to probably release the Beta to the public so they can do some heavy duty testing for you. If it's a smaller one player game you usually have an internal test team that finds all the bugs for you and you have to fix them. Most of the tests used in professional software development are automated, so they can be easily integrated with the build process. Some common testing techniques are: unit testing, regression testing, ui automation, fault injection, fuzzing and monkey testing.

Integration

When talking about business solutions, this is where you usually incorporate the software into the client's organization and let the clients employees go at it. But in gaming this is probably harder to pinpoint - I suppose the installation process this could be.

Maintenance

This usually dosent happen with console games, once it's released, that's the end of it. There's no such this as patches or updates. On PCs though, you can maintain your game through a method known as Patching.

If your software is a game engine, or physics engine, or any Middleware then it will definetly involve a lot of maintenance.

Copy protection

Copy protection for early home computer software, especially for games, started a long cat-and-mouse struggle between publishers and software cracking|crackers. These were (and are) programmers who as a hobby would defeat copy protection on software, add their pseudonym|alias to the title screen, and then distribute the cracked product to the network of warez Bulletin board system|BBSes or Internet sites that specialized in distributing unauthorized copies of software.

Software copy protection schemes for early computers such as the Apple II family|Apple II and Commodore 64 computers were extremely varied and creative because most of the floppy disk reading and writing was controlled by software, not by hardware. The first copy protection was for cassette tapes and consisted of a loader at the beginning of the tape, which read a specially formatted section which followed.

The first protection of floppy disks consisted of changing the address marks, bit slip marks, data marks, or end of data marks for each sector. For example, APPLE’s standard sector markings were:

D5 AA 96 for the address mark. That was followed by track, sector, and checksum.

DE AA EB concluded the address header with what are known as bit slip marks.

D5 AA AD was used for the data mark and the end of data mark was another DE AA EB.

Changing any of these marks required changing the software which read the floppy disk, but produced a disk that could not be copied. Some systems used complicated systems that changed the marks by track or even within a track.

By 1980 the first nibble copier, Locksmith, was introduced. These copiers reproduced copy protected floppy disks an entire track at a time, ignoring how the sectors were marked. This was harder to do than it sounds, because APPLE disks did not use the index hole to mark the start of a track. Tracks could start anywhere. Never the less, Locksmith copied APPLE II disks by taking advantage of the sync fields between sectors, which consisted of a long string of FF (hex) bytes between each sector. It found the longest string of FFs, which occurred between the last and first sectors on each track, and began writing the track in the middle of that. How APPLE used selfsync to align the drive head with the beginning of a byte (or nibble as is the proper technical term) is beyond the scope of this article.

Ironically, Locksmith would not copy itself. The first Locksmith measured the distance between sector 1 of each track. Copy protection engineers quickly figured out what Locksmith was doing and began to use the same technique to defeat it. Locksmith countered by introducing the ability to reproduce track alignment and prevented itself from being copied by embedding a special sequence of nibbles, that if found, would stop the copy process. A graduate student in computer science at the University of South Carolina reverse engineered Locksmith, found the sequence and distributed the information to some of the 7 or 8 people producing copy protection at the time.

For some time, Locksmith continued to defeat virtually all of the copy protection systems in existence. The next advance came from the previously mentioned graduate student’s thesis on software copy protection, which devised a way of replacing APPLE’s sync field of FFs, with random appearing patters of bytes. Because the graduate student had frequent copy protection discussions with APPLE’s copy protection engineer, APPLE developed a copy protection system which made use of this technique.

Of course a competitor of Locksmith, Back It UP, devised several methods for defeating that, and ultimately a method was devised for reading self sync fields directly, regardless of what nibbles they contained.

The back and forth struggle between copy protection engineers and nibble copiers continued until the APPLE II became obsolete and was replaced by the IBM PC and its clones.

Floppy disks were replaced by CDs as the preferred method of distribution, and companies like Macrovision, Sony and HexaLock providing copy protection schemes that work by writing data to places on the CD-ROM where a CD-R drive cannot normally write. Such a scheme has been used for the Sony PlayStation and cannot be circumvented easily without the use of a modchip.

For software publishers, a less expensive method of copy protection is to write the software so that it requires some evidence from the user that they have actually purchased the software, usually by asking a question that only a user with a software manual could answer (for example, "What is the 4th word on the 6th line of page 37?"). This approach can be defeated by users who have the patience to copy the manual with a photocopier, and it also suffers from BTO vulnerability, so that once crackers circumvent the copy protection on a piece of software, the resulting cracked product is more convenient than the original software, creating a disincentive to buying an original. As a result, user-interactive copy protection of this kind has mostly disappeared.

Other software copy protection techniques include:

  • A dongle, a piece of hardware containing an electronic serial number that must be plugged into the computer to run the software. This adds extra cost for the software publisher, so dongles are uncommon for games and are found mostly in expensive high-end software packages.
  • Bus encryption and encrypted code for use in Secure cryptoprocessors. This prevents copying and tampering of programs used in high security environments such as ATMs. This hardware solution is based on the fact that unlike music, video, and text that must eventually be revealed to users to be heard, viewed, or read, program instructions are needed only by the cryptoprocessor that decrypts and executes them.
  • A registration key, a series of letters and numbers that is asked for when running the program. Many computer games use registration keys. The software will refuse to run if the registration key is not typed in correctly, and multiplayer games will refuse to run if another user is online who has used the same registration key.
  • Name & Serial, a name and serial number that is given to the user at the time the software is purchased, and is required to install it.
  • Keyfile, which requires the user to have a keyfile in the same directory as the program is installed to run it.
  • A phone activation code, which requires the user to call a number and register the product to receive a computer-specific serial number.
  • Internet product activation, which requires the user to connect to the Internet and type in a serial number so the software can "call home" and notify the manufacturer who has installed the software and where, and prevent other users from installing the software if they attempt to use the same serial number.
  • Protection by code morphing (http://www.strongbit.com/execryptor_inside.asp) or code obfuscation. Code morphing protects intermediate level code such as compiled from Java and .NET languages. It breaks up the protected code into several processor commands or small command snippets and replaces them with non-standard intermediate code, while maintaining the same end result.



DevMaster navigation