Sunday, May 5, 2019

Modularity Versus Efficiency.

Modularity Versus Efficiency:
  1. Tests and systems both are considered as the modular components. since each of them are made of separate modules.
  2. A module is a defined by a distinct and small component that has a well defined purpose.
  3. It is very easy to understand the systems if the component used for constructing the system is small.
  4. Each component interacts with the other by means of interfaces.
  5. Testing process can be done / performed in the form of  modular components.
  6. Small tests are very easy to re-execute.
  7. When a bug is detected , only the small tests rather than larger test components consisting of many independent tests are execute.
  8. At the same time when a particular test has the bug then only that test was change rather than modifying the entire test plan.
  9. each test is designed in order to reduce the burden of the test design , test debugging and test execution.

Tester Versus Designer.

S.NO

                 Tester

                Designer

1)

Tester is based on the functional specifications of the system.

Designer is based on the structural specification of the system.

2)

He/she is independent on the implementations details.

He/she is dependent of the implementation details.

3)

Software tests are responsible for testing/ executing the tests.

Software designer are responsible for designing and executing the tests.

4)

Due to the lack of efficiency / implementation details , the software developed is inefficient.

The knowledge of implementation details makes the designer to develop a software that is efficient.

5)

The increase of knowledge of tests design increases the probability of removing  or eliminating unnecessary tests.

The increase of knowledge of design increases the probability of generating the faulty design.

6)

Tests are executed by the tester are free from bias therefore it is not possible to terminate the tests.

Tests are executed by the software designer are biased to the structural specification because of which the tests must withstand the drawback of structural testing.

 

Saturday, May 4, 2019

Small Versus Large and Testing Versus Debugging

S.No

                Small

                         Large

1)

Small programs comprises of few lines of code.

Large programs comprises of large number of components.

2)

They have the phases like designing , coding , testing and debugging.

They have the data dictionary to store the data and then performs the unit testing.

3)

Small programs are more efficient when compared with the large programs.

Large programs are less efficient when compared  with the small programs.

4)

The quality of the program is high.

The quality of the large programs  is always low.

5)

They do not need different techniques for testing.

They need different techniques for testing.

6)

It consists of a few components.

It consists of the large number of components.

7)

These are written by the single programmer.

These are written by the different programs.

 

S.NO

                  TESTING

                 DEBUGGING

1)

The goal of testing is to detect errors.

The goal of debugging is to detect errors and correct them.

2)

The output can be predicted.

The output cannot be predicted.

3)

Testing is a confirmation or perceptible accuracy.

Debugging is a deductive process.

4)

Testing can be planned and should be designed and then scheduled.

Procedure and duration of debugging cannot be so constrained.

5)

Testing proves the programmer’s failure.

Debugging is the programmer vindication

6)

Much of testing can be often performed by person who does not belong to the company.

Debugging cannot be performed by the person belonging to the company and has knowledge about designing and outside environment.

7)

Most of the testing can be done without a  design knowledge.

Debugging is impossible without having a detailed design knowledge.

8)

Much of test execution and design can be automated.

Automated debugging is a still a dream

 

Friday, May 3, 2019

Write a JAVA program to sort for an element in a given list of elements using bubble sort?

program:

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
class BubbleSort
{
public static void main(String a[])throws IOException
{
int arr[]=new int[100];
int n,k,i,j,temp;
BufferedReader br=new BufferedReader(new
InputStreamReader(System.in));
System.out.println("Enter the size of an array:");
n=Integer.parseInt(br.readLine());
System.out.println("Enter"+n+"number of elements:");
for(k=0;k<n;k++)
{
arr[k]=Integer.parseInt(br.readLine());
}
for(i=0;i<n;i++)
{
for(j=i+1;j<n;j++)
{
if(arr[i]>arr[j])
{
temp=arr[i];
arr[i]=arr[j];
arr[j]=temp;
}
}
}
System.out.println("Sorted array is:");
for(k=0;k<n;k++)
{
System.out.println(arr[k]);
}
}

}

output:-



Write a C program to print the Pascal Triangle.

program:

#include<stdio.h> 
main()
{
    int i,j,n,k,sp; int c;
    printf("Enter the no.of lines that you wanted to print:"); 
    scanf("%d",&n);
    sp=n; 
    for(i=0;i<n;i++)
    {
        c=1;
        for(k=sp;k>=0;k--)
        {
            printf(" ");
        }
        sp--;
        for(j=0;j<=i;j++)
        {
            printf("%8d",c);
            c=c*(i-j)/(j+1);
        }
        printf("\n");
    }
}
output:

Write a C program to print the Floyd Triangle.

program:

#include<stdio.h> 
main()
{
    int n,i,j,k;
    printf("enter a number:"); 
    scanf("%d",&n);
    k=1;
    for(j=1;j<=n;j++)
    {
        for(i=1;i<=j;i++)
        {
        printf(" %d ",k); k++;
        }
        printf("\n");
    }
}
output:-

Write a C program to check whether a given number is prime number or not.

program:


#include<stdio.h> 
main()
{
    int n,i,count=0; 
    printf("enter a number:"); 
    scanf("%d",&n); 
    for(i=2;i<n;i++)
    {
        if(n%i==0)
        {
            count++;
        }
    }
    if(count==0)
    {
        printf("the given number is a prime\n"); 
    }
    else
    {
        printf("the given number is not a prime\n");
    }
}

 output: