Software Engineering: GATE CS Previous Year Questions

Software Engineering · Software Engineering and Web Technology

56 questions · asked in 11 of 27 years (2000–2026)

MCQ 53 · NAT 31-mark 42 · 2-mark 14

2000Questions per year2026

Questions 11–15 of 56

Q11GATE 2014 (Session 3)1 markMCQ−0.33 if wrong
In the context of modular software design, which one of the following combinations is desirable?

Q12GATE 20132 marksMCQ−0.67 if wrong
The procedure given below is required to find and replace certain characters inside an input character string supplied in array A. The characters to be replaced are supplied in array oldc, while their respective replacement characters are supplied in array newc. Array A has a fixed length of five characters, while arrays oldc and newc contain three characters each. However, the procedure is flawed
void find_and_replace (char *A, char *oldc, char *newc) {
for (int i=0; i<5; i++)
for (int j=0; j<3; j++)
if (A[i] == oldc[j]) A[i] = newc[j];
}
The procedure is tested with the following four test cases.
(1) oldc = "abc", newc = "dab"
(2) oldc = "cde", newc = "bcd"
(3) oldc = "bca", newc = "cda"
(4) oldc = "abc", newc = "bac"
If array A is made to hold the string "abcde", which of the above four test cases will be successful in exposing the flaw in this procedure?

Q13GATE 20132 marksMCQ−0.67 if wrong
The procedure given below is required to find and replace certain characters inside an input character string supplied in array A. The characters to be replaced are supplied in array oldc, while their respective replacement characters are supplied in array newc. Array A has a fixed length of five characters, while arrays oldc and newc contain three characters each. However, the procedure is flawed
void find_and_replace (char *A, char *oldc, char *newc) {
for (int i=0; i<5; i++)
for (int j=0; j<3; j++)
if (A[i] == oldc[j]) A[i] = newc[j];
}
The procedure is tested with the following four test cases.
(1) oldc = "abc", newc = "dab"
(2) oldc = "cde", newc = "bcd"
(3) oldc = "bca", newc = "cda"
(4) oldc = "abc", newc = "bac"
The tester now tests the program on all input strings of length five consisting of characters 'a', 'b', 'c', 'd' and 'e' with duplicates allowed. If the tester carries out this testing with the four test cases given above, how many test cases will be able to capture the flaw?

Q14GATE 20132 marksMCQ−0.67 if wrong
The following figure represents access graphs of two modules M1 and M2. The filled circles represent methods and the unfilled circles represent attributes. If method m is moved to module M2 keeping the attributes where they are, what can we say about the average cohesion and coupling between modules in the system of two modules?
Module M1Module M2m

Q15GATE 20112 marksMCQ−0.67 if wrong
The following is comment written for a C function /* This function computes the roots of a quadratic equation a.x^2+b.x+c=0. The function stores two real roots in *root1 and *root2 and returns the status of validity of roots. It handles four different kinds of cases.

i When coefficient a is zero irrespective of discriminant
ii When discriminant is positive
iii When discrimanant is zero
iv When discrimanant is negative

Only in cases ii and iii , the stored roots are valid.

Otherwise 0 is stored in the roots.

The function returns 0 when the roots are valid and -1 otherwise.

The functin also ensures root1>=root2.

int get_QuadRoots float a, ( float b, float c, float *root1, float *root2);
* /

A software test engineer is assigned the job of doing black box testing. He comes up with the following test cases, many of which are redundant.
Test Case Input Set Expected Output Set a b c root1 root2 Return Value T1 0.0 0.0 7.0 0.0 0.0 −1 T2 0.0 1.0 3.0 0.0 0.0 −1 T3 1.0 2.0 1.0 −1.0 −1.0 0 T4 4.0 −12.0 9.0 1.5 1.5 0 T5 1.0 −2.0 −3.0 3.0 −1.0 0 T6 1.0 1.0 4.0 0.0 0.0 −1
Which one of the following options provide the set of non-redundant tests using equivalence class partitioning approach from input perspective for black box testing?

Keep practising

Topics in Software Engineering and Web Technology

All CS topics ›
Software EngineeringYou are here56 questions · asked in 11 years
Web Technology15 questions · asked in 7 years