Showing posts with label SDLC. Show all posts
Showing posts with label SDLC. Show all posts

Wednesday, October 10, 2018

The Importance of Unit Testing

One of the qualities of a good software developer is high attention to detail but nevertheless, errors can escape even the very best of developers. That is why testing and debugging is a huge part of the Software Development Life Cycle (SDLC). Software testing even has its own field of specialization; some organizations hire testers who are specialized in testing software, instead of assigning the responsibility to software developers. However, every software developer needs to know how to test their own code to produce quality deliverables.

Four Levels of Software Testing

The "Software Testing Fundamentals" website explains how there are four levels of testing in the SDLC namely: unit testing, integration testing, system testing and acceptance testing.

In unit testing, individual components of a software application are tested to validate that each component performs as designed.

In integration testing, individual components are combined and tested as a group to expose faults in how they interact with each other.

In system testing, the complete, integrated system is tested to determine if it meets specified requirements.

In acceptance testing, the system is tested to evaluate its compliance with business requirements and determine whether it's acceptable for delivery.

Unit Testing

The website also describes unit testing in detail. A unit/component is the smallest, testable part of a software application like a program, function, procedure or method. These units are tested using a software testing method called the "white box testing method", in which the internal structure of the item being tested is known to the tester. Unit testing is often performed by software developers themselves. Testing is based on an analysis of the internal structure of the component or system.

Some of the benefits of unit testing according to Ekaterina Novoseltseva (2017) is that it improves the quality of code, bugs are found at an early stage and it helps in maintaining and changing the code.

An Example of a Unit Test

Below is a method that truncates a string:

public static class StringExtender
    {
        public static string Truncate(this string source, int length)
        {
            //If source is null, return null.
            if (source.Length > length)
            {
                source = source.Substring(0, length);
            }
            return source;
        }
    }

The following code is a unit test built with MSTest on Visual Studio 2017:

    [TestClass()]
    public class StringExtenderTests
    {
        [TestMethod()]
        public void TruncateTest()
        {
            //arrange
            string source = "Original Source";
            int length = 0;
            string sourceTruncated = string.Empty;

            //act
            sourceTruncated = source.Truncate(length);

            //assert
            Assert.AreNotEqual(source, sourceTruncated);
        }
    }

The code that is added in the test method tests whether the original string has been modified to indicate that the truncate method has been implemented. When you run the test you will see whether the test failed or was successful. When the test passes it means the truncate method was executed successfully.

Interview with Lulu Ndhlovu

Lulu is a software developer with 4 years of experience working mainly with web applications. It was a delight interviewing her to gain insight into the importance of unit testing.

Q: Where did you first learn about unit testing?

A: In my first job at Boxfusion

Q: How often do you practice unit testing?

A: Not often I only did it once.

Q: How has it impacted your performance and quality of work?

A: It was very convenient because we were doing testing with Paypal integration so that's something important you need to make sure is working. We tested the methods that were necessary that needed to call the services for Paypal.

Q: Do you recommend unit testing to all developers and organizations?

A: Yeah. If you have the time in your project.

In conclusion, unit testing is the best way to ensure that components of your software application work individually. Every developer should acquire the skill especially for projects that cannot afford to have minimum security.

References:

  1. Software Testing Fundamentals (n.d.) Software Testing Levels [online] Available from: http://softwaretestingfundamentals.com/software-testing-levels/ [Accessed on 10 October 2018]
  2. Software Testing Fundamentals (n.d.) Unit Testing [online] Available from: http://softwaretestingfundamentals.com/unit-testing/ [Accessed on 10 October 2018]
  3. Software Testing Fundamentals (n.d.) Unit Testing [online] Available from: http://softwaretestingfundamentals.com/white-box-testing/ [Accessed on 10 October 2018]
  4. Novoseltseva, E. (2017) Top 8 Benefits of Unit Testing [online] Available from: https://apiumhub.com/tech-blog-barcelona/top-benefits-of-unit-testing/ [Accessed on 10 October 2018]

Friday, July 6, 2018

A Dichotomy Between Agile and RAD Development

Developing software requires a methodology to produce a quality software product on time and within budget.

There are various methods within the Software Development Life Cycle (SDLC) to select from and each can be selected according to the project's needs. But many organizations these days employ one method for all their software projects.

On the Version One website agile is described as an iterative and incremental methodology where the software team iterates through a project, delivers software incrementally, and continually plans and tests the software application.

On the other hand, RAD (Rapid Application Development) is described as being based on rapid prototyping and iterative and incremental development without any specific planning involved, by Tutorials Point. 

A prototype is a working model that is functionally equivalent to a component of the product (Tutorials Point).

Below are the advantages and disadvantages of Agile and RAD development listed on Tutorials Point.

Agile
Advantages Disadvantages
Is a very realistic approach to software development. Not suitable for handling complex dependencies.
Promotes teamwork and cross training. More risk of sustainability, maintainability and extensibility.
Functionality can be developed rapidly and demonstrated. An overall plan, an agile leader and agile PM practice is a must without which it will not work.
Resource requirements are minimum. Strict delivery management dictates the scope, functionality to be delivered, and adjustments to meet the deadlines.
Suitable for fixed or changing requirements Depends heavily on customer interaction, so if customer is not clear, team can be driven in the wrong direction.
Delivers early partial working solutions. There is a very high individual dependency, since there is minimum documentation generated.
Good model for environments that change steadily. Transfer of technology to new team members may be quite challenging due to lack of documentation.
Minimal rules, documentation easily employed.
Enables concurrent development and delivery within an overall planned context.
Little or no planning required.
Easy to manage.
Gives flexibility to developers.

RAD
Advantages Disadvantages
Changing requirements can be accommodated. Dependency on technically strong team members for identifying business requirements.
Progress can be measured. Only system that can be modularized can be built using RAD.
Iteration time can be short with use of powerful RAD tools. Requires highly skilled developers/designers.
Productivity with fewer people in a short time. High dependency on modeling skills.
Reduced development time. Inapplicable to cheaper projects as cost of modeling and automated code generation is very high.
Increases reusability of components. Management complexity is more.
Quick initial reviews occur. Suitable for systems that are component based and scalable.
Encourages customer feedback. Requires user involvement throughout the life cycle.
Integration from very beginning solves a lot of integration issues. Suitable for project requiring shorter development times.

References:

Version One (n.d.) The Evolution of the Agile Software Methodology [online] Available at: https://www.versionone.com/agile-101/ [Accessed 6 July ]

Tutorials Point (n.d.) SDLC - Agile Model [online] Available at: https://www.tutorialspoint.com/sdlc/sdlc_agile_model.htm [Accessed 6 June]

Tutorials Point (n.d.) SDLC - RAD Model [online] Available at: https://www.tutorialspoint.com/sdlc/sdlc_rad_model.htm [Accessed 6 June]



How to Access the Metaverse

In February this year, Bernard Marr predicted that "in 2022, we'll see new, lighter, more portable VR devices, so instead of having...