Experiment 12 Software Engineering Rishit Toteja 2k20 Ee 217

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

SOFTWARE ENGINEERING

CO-301
EXPERIMENT - 12
RISHIT TOTEJA
(2K20/EE/217)

AIM - To create a program to predict reliability metric using different models.

THEORY -

Reliability metrics are used to quantitatively expressed the reliability of the software product.
The option of which metric is to be used depends upon the type of system to which it applies
& the requirements of the application domain.
Some reliability metrics which can be used to quantify the reliability of the software
product are as follows:

1. Mean Time to Failure (MTTF):


MTTF is described as the time interval between the two successive failures. An MTTF
of 200 mean that one failure can be expected each 200-time units. The time units are
entirely dependent on the system & it can even be stated in the number of transactions.
MTTF is consistent for systems with large transactions.

For example, it is suitable for computer-aided design systems where a designer will work
on a design for several hours as well as for Word-processor systems.

To measure MTTF, we can evidence the failure data for n failures. Let the failures
appear at the time instants t1,t2......tn.

MTTF can be calculated as


2. Mean Time to Repair (MTTR):

Once failure occurs, some-time is required to fix the error. MTTR measures the average
time it takes to track the errors causing the failure and to fix them.

3. Mean Time Between Failure (MTBR):

We can merge MTTF & MTTR metrics to get the MTBF metric.
MTBF = MTTF + MTTR

Thus, an MTBF of 300 denoted that once the failure appears, the next failure is
expected to appear only after 300 hours. In this method, the time measurements are
real-time & not the execution time as in MTTF.

CODE -

#include <iostream>
#include <math.h>
#include <stdlib.h>
using namespace std;
int main()
{
float choice, fi1, fi2, ef1, ef2, fit1, fidp, et1, et2;
cout << "Implement\n1.Basic Execution Time Model\n2.Logarithmic Poisson Execution
Time \n\nEnter choice : ";
cin >> choice;
if (choice == 1)
{
cout << "Enter failure intensity at the start of execution\n";
cin >> fi1;
cout << "Enter expected number of failures experienced\n";
cin >> ef1;
cout << "Enter number of failures that occur in infinite time\n";
cin >> fit1;
cout << "Enter execution time\n";
cin >> et1;
cout << "Current Failure Intensity:" << (fi1 * (1 - (ef1 / fit1))) <<
endl; cout << "Slope of failure intensity function:" << -fi1 / fit1 << endl;
cout << "No of failures at execution time:" << fit1 * (1 - exp(-(fi1 * et1) /
fit1)) << endl;
cout << "Failure intensity at execution time:" << fi1 * exp(-fi1 *
et1 / fit1) << endl;
}
else if (choice == 2)
{
cout << "Enter failure intensity at the start of execution\n";
cin >> fi2;
cout << "Enter expected number of failures experienced\n";
cin >> ef2;
cout << "Enter failure intensity delay parameter\n";
cin >> fidp;
cout << "Enter execution time\n";
cin >> et2;
cout << "Current Failure Intensity:" << fi2 * exp(-fidp * ef2) << endl; cout << "Slope of
failure intensity function:" << -fidp * fi2 * exp(-fidp * ef2) << endl;
cout << "No of failures at execution time:" << log((fi2 * fidp * et2) + 1) / fidp << endl;
cout << "Failure intensity at execution time:" << fi2 / ((fi2 * fidp * et2) + 1) << endl;
}
else
cout << "Wrong choice\n";
return 0;
}
OUTPUT -
PRECAUTIONS -

1. Ensure that the code handles edge cases, such as invalid inputs, gracefully.
2. Validate the correctness of the program's logic for both triangle classification and
weekday calculation.
3. Properly format and comment your code for clarity and maintainability.

You might also like