Softwere Engineering -1

  • Work-from-home

Mahen

Alhamdulillah
VIP
Jun 9, 2012
21,845
16,877
1,313
laнore
Software Engineering -1


Question No: 1
Define Asynchronous Messages and Synchronous Messages.

Answer:
Asynchronous Messages:

Asynchronous messages are “signals,” denoted by a half arrow. They do not block the caller. Asynchronous
messages typically perform the following actions:
1 Create a new thread
2 Create a new object
Communicate with a thread that is already running

Synchronous Messages:

Synchronous messages are “call events” and are denoted by the full arrow. They represent nested flow of
control which is typically implemented as an operation call. In case of a synchronous message, the caller waits
for the called routine to complete its operation before moving forward.

Question No: 2
Law of balancing act in software

Answer:

The Balancing Act!
Software Engineering is actually the balancing act. You have to balance many things like cost, user
friendliness, Efficiency, Reliability etc. You have to analyze which one is the more important feature for your
software is it reliability, efficiency, user friendliness or something else. There is always a trade-off among all
these requirements of software. It may be the case that if you try to make it more user-friendly then the
efficiency may suffer. And if you try to make it more cost-effective then reliability may suffer. Therefore there
is always a trade-off between these characteristics of software. These requirements may be conflicting. For
example, there may be tension among the
following:

1 Cost vs. Efficiency
2 Cost vs. Reliability
3 Efficiency vs. User-interface
A Software engineer is required to analyze these conflicting entities and tries to strike a balance.


Question No: 3
HOW DO YOU DETERMINE THAT AN OBJECTIVE BELONGS TO CERTAIN CLASS?

Answer:
The basic unit of object oriented design is an object. An object can be defined as a tangible entity that exhibits
some well defined behavior. The structure and behavior of similar objects are defined in their common class. A
class specifies an interface and defines an implementation.

Question No: 4
What is meant by “System’s Static View"?

Answer:

Static view of semantic classes.
Requirements are assessed and classes are extracted (and represented) as part of the analysis model.

Static view of attributes.
Every class must be explicitly described. The attributes associated with the class

provide a description of the class.
Static view of relationships.
Objects are “connected” to one another in a variety of ways. The analysis model must represent these.

Static view of behaviors.
The relationships just noted define a set of behaviors that accommodate the usage scenario (use-cases) of the
system

Question No: 5
What is behavior driven perceptive of an objective?

Answer:
Behavior is how an object acts and reacts in terms of its state changes and message passing. The behavior of an
object is completely defined by its actions. A message is some action that one object performs upon another in
order to elicit a reaction. The operations that clients may perform upon an object are called methods.

Question No: 6
What is Textual Analysis? Explain it

Answer:
Textual analysis was developed by Abbot and then extended by Graham and others. In this technique different
parts of speech are identified within the text of the specification and these parts are modeled using different
components.

Question No: 7
What is Software Architecture?

Answer:
Architecture is the organizational structure of a system. Architecture can be recursively decomposed into parts
that interact through interfaces, relationships that connect parts, and constraints for assembling parts. Parts that
interact through interfaces include classes, components and subsystems.

Question No: 8
What is the Cardinality of Objective?

Answer :

Cardinality. The data model must be capable of representing the number of occurrences Objects in a given
relationship. Tillmann [TIL93] defines the cardinality of an object/relationship pair in the following manner:

1) One-to-one (l:l)—An occurrence of [object] 'A' can relate to one and only one occurrence of [object]
'B,' and an occurrence of 'B' can relate to only one occurrence of 'A.'
2) One-to-many (l:N)—One occurrence of [object] 'A' can relate to one or many occurrences of [object]
'B,' but an occurrence of 'B' can relate to only one occurrence of 'A.' For example, a mother can have
many children, but a child can have only one mother.
3) Many-to-many (M:N)—An occurrence of [object] 'A' can relate to one or more occurrences of 'B,'
while an occurrence of 'B' can relate to one or more occurrences of 'A.' For example, an uncle can have
many nephews, while a nephew can have many uncles.

Question No: 9
Define abstraction?

Answer:
An abstraction is a technique in which we construct a model of an entity based upon its essential characteristics
and ignore the inessential details.

Question No: 10
Is the design of software architecture a creative process?

Answer:
Design of software architecture is a creative and iterative process. This involves performing a number of
activities, not necessarily in any particular order or sequence.

Question No: 11
Suppose you are working as a software engineer involved in the development of an e-commerce website.
What are the 2 most important characteristics your software must have?

Answer:
Two most important characteristics are that software should be reliable and useable.

Question No: 12
What is the purpose of collaboration diagrams?

Answer:
Collaboration diagrams can also be used to depict the dynamic behavior of a system. They show how objects
interact with respect to organizational units (boundaries!). Collaboration diagrams can also show synchronous,
asynchronous, create, and destroy message using the same notation as used in sequence diagrams.

Question No: 13
What is the difference between Aggregation and Association?

Answer:
As compared to association, aggregation implies a tighter coupling between the two objects which are involved
in this relationship. Therefore, one way to differentiate between aggregation and association is that if the two
objects are tightly coupled, that is, if they cannot exist independently, it is an aggregation, and if they are
usually considered as independent, it is an association.

Question No: 14
what parameters are used to measure and analyze design quality?

Answer:
A software design can be looked at from different angles and different parameters can be used to measure and
analyze its quality. These parameters include efficiency, compactness, reusability, and maintainability. A good
design from one angle may not seem to be suitable when looked from a different perspective. For example, a
design that yields efficient and compact code may not be very easy to maintain. In order to establish whether a
particular design is good or not, we therefore have to look at the project and application requirements.


Question No: 15
Discuss some of the purpose of interacting diagram?

Answer:
The purposes of interaction diagrams are to visualize the interactive behaviour of the system. Now visualizing
interaction is a difficult task. So the solution is to use different types of models to capture the different aspects
of the interaction.
That is why sequence and collaboration diagrams are used to capture dynamic nature but from a different angle.

So the purposes of interaction diagram can be describes as:
1 To capture dynamic behaviour of a system.
2 To describe the message flow in the system.
3 To describe structural organization of the objects.
4 To describe interaction among objects.

Question No: 16
What should be consideration for maintain design?

Answer:
In order to make a design that is maintainable, it should be understandable and the changes should be local in
effect. That is, it should be such that a change in some part of the system should not affect other parts of the
system. This is achieved by applying the principles of modularity, abstraction, and separation of concern. If
applied properly, these principles yield a design that is said to be more cohesive and loosely coupled and thus is
easy to maintain.


Question No: 18
It is fact that good design makes maintenance easier. Which design principle help this to be achieved?

Answer:
A good design from one angle may not seem to be suitable when looked from a different perspective. For
example, a design that
yields efficient and compact code may not be very easy to maintain. In order to establish whether a particular
design is good or not, we therefore have to look at the project and application requirements.

Question No: 19
To manage the complexity of the system we need to apply the principle of abstraction. Discuss briefly?

Answer:

An abstraction is a technique in which we construct a model of an entity based upon its essential characteristics
and ignore the inessential details. The principle of abstraction also helps us in handling the inherent complexity
of a system by allowing us to look at its important external characteristic, at the same time, hiding its inner
complexity. Hiding the internal details is called encapsulation.

Question No: 20
Differentiate between architectural design and system architecture in a single line?

Answer:
Architecture faces towards strategy, structure and purpose, towards the abstract while Design faces towards
implementation and practice, towards the concrete.

Question No: 21
What are architectural designs Process, explain briefly?

Answer:
System structuring:

System structuring is concerned with decomposing the system into interacting sub-systems. The system is
decomposed into several principal sub-systems and communications between these sub-systems are identified.

Control modeling:

Control modeling establishes a model of the control relationships between the different parts of the system.

Modular decomposition:

During this activity, the identified sub-systems are decomposed into modules. This design process is further
elaborated in the following section where architectural views are discussed.


Question No: 22
Discuss the relationship between sequence diagram and logical complexity?

Answer:
It is important to understand that the diagrams are meant to make things clear. Therefore, in order to keep them
simple, special attentions should be paid to the conditional logic. If it is simple then there is no harm in adding
it to the diagram. On the other hand if the logic is complex then we should draw separate diagrams like flow
charts.


Question No: 23
Define Motivation of GUI

Answer:
Motivation for GUI
1 System users often judge a system by its interface rather than its functionality
2 A poorly designed interface can cause a user to make catastrophic errors
3 Poor user interface design is the reason why so many software systems are never used

Question No: 24
Keeping in mind the Connie's case study, what rule of thumbs was identified, list them down.

Answer:
Who I Know - Rules of Thumb
1 an actor knows about its participants person knows about cashier
2 a transaction knows about its participants a session knows about its register and cashier
3 A transaction contains its transaction line items sale contains its sales line items
4 A transaction knows its sub transactions session knows about its sales sale knows about its payments
5 A place knows about its transactions store knows about its sessions
6 A place knows about its descriptive objects store knows about its tax categories
7 A container knows about its contents a store knows about its cashiers, items, and registers

Question No: 25
The CPU of a computer consists of an ALU and a CU. Intel and AMD are two types of CPUs, which are
widely used in computers. Users of computers can be either novices or experts.
Consider the following classes.

(i) CPU and AMD
(ii) User and Computer
(iii) CPU and ALU

Answer:

CPU and AMD:

There is relationship between CPU and AMD is “A kind of” type as AMD is a kind of CPU.

User and Computer:

The relationship between User and Computer is “simple Association” type as there is weak relationship
between user and computer.

CPU and ALU:

Relationship between CPU and ALU is “composition” type as ALU is a part of CPU.

Question No: 26
What is action-oriented approach for Software Design?

Answer:
In the case of action-oriented approach, data is decomposed according to functionality requirements. That is,
decomposition revolves around function. In the OO approach, decomposition of a problem revolves around
data. Action-oriented paradigm focuses only on the functionality of a system and typically ignores the data until
it is required. Object- oriented paradigm focuses both on the functionality and the data at the same time. The
basic difference between these two is decentralized control mechanism versus centralized control mechanism
respectively. Decentralization gives OO the ability to handle essential complexity better than action-oriented
approach.

Question No: 27
Collaboration Diagrams depict Dynamic behavior of the system, explain it.

Answer:

Collaboration diagrams:

Collaboration diagrams can also be used to depict the dynamic behavior of a system. They show how objects
interact with respect to organizational units (boundaries!).
Since a boundary shapes communication between system and outside world e.g. user interface or other system,
collaboration diagrams can be used to show this aspect of the system. The sequence of messages determined by
numbering such as 1, 2, 3, 4, This shows which operation calls which other operation.

Question No: 28
To manage the complexity of the system we need to apply the principles of separation of concern. Discuss
briefly

Answer:

Separation of concern allows us to deal with different individual aspects of a problem by considering these
aspects in isolation and independent of each other. A complex system may be divided into smaller pieces of
lesser complexity called modules.

Question No: 29

What is elaborated Use case? Explain it

Answer:
After the derivation of the use case model, each use is elaborated by adding detail of interaction between the
user and the software system. An elaborated use case has the following components:
Use Case Name, actors, summary, precondition, post-condition, extend, uses, normal course of events,
alternative path, exception, assumption.


Question No: 30

How can we decrease Coupling explain it.

Answer:
That is, we can reduce the coupling of a system by minimizing the number of messages in the protocol of a
class.

Question No: 31

Narrate some of the architectural design guidelines that can help in addressing non-functional
requirements challenges.

Answer:
Software architecture must address the non-functional as well as the functional requirements of the software
system. Following are some of the architectural design.
Performance –Performance can be enhanced by localizing operations to minimize sub-system communication.

That is, try to have self-contained modules as much as possible so that inter-module communication is
minimized.
Security –Security can be improved by using a layered architecture with critical assets put in inner layers.
Safety –Safety-critical components should be isolated
Availability –Availability can be ensured by building redundancy in the system and having redundant
components in the architecture.
Maintainability–Maintainability is directly related with simplicity. Therefore, maintainability can be increased
by using fine-grain, self-contained components.

Question No: 32

What is the importance of Classification in identifying Classes and objects?

Answer:
Consider a large university library. Tens of thousands of books, periodicals, and other information resources are
available for use. But to access these resources, a categorization scheme must be developed. To navigate this
large volume of information, librarians have defined a classification scheme that includes a Library of Congress
classification code, keywords, author names, and other index entries. All enable the user to find the needed
resource quickly and easily.


Question No: 33

What is the difference between Association and composition?

Answer:

In Association, interacting objects have no intrinsic relationship with other object. It is the weakest link
between objects. While in Composition An object may be composed of other smaller objects, the relationship
between the “part” objects and the “whole”.


Question No: 34
How the objects are identified in peter codd’s technique?

Answer:

Objects are identifying in the following way.

Select actors

Actors are people and organizations that take part in the system under consideration.Examples of actors are:
person, organization (agency, company, corporation, foundation).

Select Participants

A participant is a role that each actor plays in the system under consideration. Examples of participants are:
agent, applicant, buyer, cashier, clerk, customer, dealer, and distributor. Etc.


Select Places

Places are where things come to rest or places that contain other objects. Examples of places are: airport,
assembly-line, bank, city, clinic, country, depot, garage and hospital etc.

Select Transactions

Transactions are the “events”. These transactions usually come from a window (GUI), some object which
monitors for significant event and logs that information, or a another system that interacts with the system
under consideration and logs some information. Examples of transactions are: agreement, assignment,
authorization, contract, delivery, deposit, incident, inquiry, order, payment, problem report, purchase and sales
etc.


Select Container Objects

Containers are objects that hold other objects. e.g. bin, box, cabinet, folder, locker, safe, shelf, etc. Therefore a
place is also a container but every container need not be a place.


Select Tangible things

Take a “walk” through the system and select “tangible” things around you used in the problem domain. These
may be characterized as all the remaining (not yet selected) “nouns” that make up the problem domain.
Examples are: account, book, calendar, cash box, cash drawer, item, plan, procedure, product, schedule, skill,
tool, etc


Question No: 35

Define cohesion.

Answer:
Cohesion is an internal property of a module. Cohesion describes the intra-component linkages while couple
shows the inter-component linkages. Cohesion measures the independence of a module.
 

Mahen

Alhamdulillah
VIP
Jun 9, 2012
21,845
16,877
1,313
laнore
Question No: 36
Keeping connie’s case study in mind, as discussed in lecture, list down whole parts structures which were
identified.

Answer:

Identify Whole-Part Structures
1 A store as a whole is made up of cashiers, registers, and items.
2 A register contains a cash drawer.
3 A sale is constituted of sale line items.

Question No: 37
Define data flow diagram

Answer:

A data flow diagram (DFD) is a graphical representation of the "flow" of data through an information system,
modeling its process aspects. Often they are a preliminary step used to create an overview of the system which
can later be elaborated.


Question No: 38
comparison of software architecture and Building architecture

Answer:

When building a house, the architect, the general contractor, the electrician, the plumber, the interior designer,
and the landscaper all have different views of the structure. Although these views are pictured differently, all
are inherently related: together, they describe the building’s architecture. The same is true with software
architecture. Architectural design basically establishes the overall structure of a software system.


Question No: 39
Code example of High Coupling

Answer:

Tightly Coupled Example:

public class CartEntry
{
public float Price;
public int Quantity;
}

public class CartContents
{
public CartEntry[] items;
}

public class Order
{
private CartContents cart;
private float salesTax;

public Order(CartContents cart, float salesTax)
{
this.cart = cart;
this.salesTax = salesTax;
}

public float OrderTotal()
{
float cartTotal = 0;
for (int i = 0; i < cart.items.Length; i++)
{
cartTotal += cart.items.Price * cart.items.Quantity;
}
cartTotal += cartTotal*salesTax;
return cartTotal;
}
}


Question No: 40
Adding user interface detail in the SRS is controversial a creative process i.e by adding GUI detail to the SRS
document, focus e shift from what to how (analysis design) do you agree ?

Answer:
Yes I am agree because Client appreciates more the contents of the SRS document if our SRS document contains
the GUI details than if we don’t have them there.



@Don @ChoCo @diya. @ShyPrincess @Qawareer @Prince_Farry kisi ko help ciye tou bata dye sleep(} Diya ko :p
 

Mahen

Alhamdulillah
VIP
Jun 9, 2012
21,845
16,877
1,313
laнore
Question No: 41
What is Software Testing?

Answer:
To understand the concept of software testing correctly, we need to understand a few related concepts.

Question No: 42
Write unit testing qualitative benefits.

Answer:

Assessment-oriented: Writing the unit test forces us to deal with design issues - cohesion, coupling.
Confidence-building: We know what works at an early stage. Also easier to change when it’s easy to retest.

Question No: 43
Where Term Compute can be used in Methods?

Answer:

The term compute can be used in methods where something is computed.
valueSet.computeAverage(); matrix.computeInverse()

Question No: 44
Which of the following is a/are non-functional requirement of an e-learning system?

(a) User friendliness
(b) Time taken to download study materials through the system should not be too long.
(c) On-line assignment submission facility
(d) On-line chatting facility
(e) Robustness

Answer:

(a) User friendliness

Question No: 45
Write unit testing principles.

Answer:

  • In unit testing, developers test their own code units (modules, classes, etc.) during implementation.
  • Normal and boundary inputs against expected results are tested.
  • Thus unit testing is a great way to test an API.

Question No: 46
The use of do.... while loops should be avoided. Explain why ?

Answer:

The use of do.... While loops should be avoided. There are two reasons for this. First is that the construct is
superfluous; Any statement that can be written as a do.... while loop can equally well be written as a while loop
or a for loop. Complexity is reduced by minimizing the number of constructs being used. The other reason is of
readability. A loop with the conditional part at the end is more difficult to read than one with the conditional at
the top.

Question No: 47
Give 3 Equivalence partitioning guidelines

Answer:

1. Organize your equivalence classes. Write them in some order, use some template, sequence, or group
them based on their similarities or distinctions. These partitions can be hierarchical or organized in anyother manner.
2. Boundary conditions: determine boundary conditions. For example, adding in an empty linked list,
adding after the last element, adding before the first element, etc.
3. You should not forget invalid inputs that a user can give to a system. For example, widgets on a GUI,
numeric instead of alphabets, etc.


Question No: 48
Discus the symptoms and an example of memory overrun bug class.

Answer:

Symptoms

1. Program crashes quite regularly after a given routine is called, that routine should be examined for a
possible overrun condition.
2. If the routine in question does not appear to have any such problem the most likely cause is that another
routine, called in the prior sequence, has already trashed variables or memory blocks.
3. Checking the trace log of the called routines leading up to one with the problem will often show up the
error.

Example

The array only has 50 slots available in its allocation. What happens at that point is that the function goes past
the end of the array and starts to walk on things beyond its control.
const kMaxEntries = 50;
int gArray[kMaxEntries];
char szDummyBuffer[256];
int nState = 10;
int ZeroArray (int *pArray)
{
for (inti=0;i<100;++i)
pArray = 0;
}


Question No: 49
Write at leas 5 General Naming conventions for C++ or Java

Answer:

1. Names representing types must be nouns and written in mixed case starting with upper case.
Line, FilePrefix

2. Variable names must be in mixed case starting with lower case.
line, filePrefix

3. Names representing constants must be all uppercase using underscore to separate words.
MAX_ITERATIONS, COLOR_RED

4. Names representing methods and functions should be verbs and written in mixed case starting with lower
case.
getName(), computeTotalWidth()

5. Names representing template types in C++ should be a single uppercase letter.
template<class T>
template<class C, class D>


Question No: 50
Explain at least 2 code structures.

Answer:

Case:-
In Case statement, control can take either of several branches (as opposed to only two in If statement.) First
node represents the switch statement (C/C++) and nodes in middle correspond to all different cases. Program
can take one branch and result into the same instruction.

While
A while loop structure consists of a loop guard instruction through which the iteration in the loop is controlled.
The control keeps iterating in the loop as long as the loop guard condition is true. It branches to the last
instruction when it becomes false.


Question No: 51
What does this mean” Object Creation and Life Time”?

Answer:

From the object creation and life time point of view, when an object is instantiated, all of its parts must also be
instantiated at the same time before any useful work can be done and all of its part die with it. While in the case
of association, the life time of two associated object is independent of one another. The only limitation is that
an object must be alive or has to be instantiated before a message can be sent to it.

Question No:52
How one can avoid hazards caused by side effects while writing code. List the two guidelines.

Answer:

never use “,” except for declaration
never use multiple assignments in the same statement

Question No: 53
What is the greatest advantage of exception handling?

Answer:

One of the most powerful features of exception handling is that an error can be thrown over function
boundaries. This allows programmers to put the error handling code in one place, such as the main-function of
your program.

Question No: 54
Give 2 Unit Testing Tips.

Answer:

1. For small projects you can imbed the unit test for a module in the module itself
2. For larger projects you should keep the tests in the package directory or a /test subdirectory of the
package

Question No: 54
Write unit testing quantitative benefits.

Answer:

1. Repeatable: Unit test cases can be repeated to verify that no unintended side effects have occurred due
to some modification in the code.
2. Bounded: Narrow focus simplifies finding and fixing defects.
3. Cheaper: Find and fix defects early


Question No: 55
How Comments should be indented relative to their position in the code? Give an example

Answer:

Comments should be indented relative to their position in the code.
while (true) { // NOT: while (true) {
// Do something // // Do something
something(); // something();
} // }


Question No: 56
Narrate the manner for the organization of Class and Interface declarations

Answer:

Class and Interface declarations should be organized in the following manner:
1. Class/Interface documentation.
2. Class or interface statement.
3. Class (static) variables in the order public, protected, package (no access modifier), private.
4. Instance variables in the order public, protected, package (no access modifier), private.
5. Constructors.
6. Methods (no specific order).


Question No: 57
Discus the symptoms and an example of coding error bug class.

Answer:

Symptoms
  1. Unexpected errors in black box testing.
  2. The errors that unexpectedly occur are usually caused by coding errors.
  3. Compiler warnings.
  4. Coding errors are usually caused by lack of attention to details.
Example

In the following example, a function accepts an input integer and converts it into a string
that contains that integer in its word representation.
void convertToString(int InInteger,
char* OutString, int* OutLength)
{
switch(InInteger){
case 1: OutString = "One";OutLength = 3;
break;
case 2: OutString = "Two";OutLength = 3;
break;
case 3: OutString = "Three";OutLength = 5;
break;
case 4: OutString = "Four";OutLength = 4;
break;
case 5: OutString = "Five";OutLength = 4;
break;
case 6: OutString = "Six";OutLength = 3;
break;
case 7: OutString = "Seven";OutLength = 5;
break;
case 8: OutString = "Eight";OutLength = 5;
break;
case 9: OutString = "Nine";OutLength = 4;
break;
}
}

Question No: 58
Why Code portability is so important? Give out 3 ways / Guide lines to improve the code portability
with examples

Answer:

Many applications need to be ported on to many different platforms. As we have seen, it is pretty hard to write
error free, efficient, and maintainable software. So, if a major rework is required to port a program written for
one environment to another, it will be probably not come at a low cost. So, we ought to find ways and means by
which we can port applications to other platforms with minimum effort. The key to this lies in how we write
our program. If we are careful during writing code, we can make it portable. On the other hand if we write code
without portability in mind, we may end-up with a code that is extremely hard to port to other environment.
Following is brief guideline that can help you in writing portable code.

Stick to the standard
1. Use ANSI/ISO standard C++
2. Instead of using vendor specific language extensions, use STL as much as possible

Program in the mainstream

Although C++ standard does not require function prototypes, one should always write them.
double sqrt(); // old style acceptable by ANSI C
double sqrt(double); // ANSI – the right approach

Size of data types

Sizes of data types cause major portability issues as they vary from one machine to the other so one should be
careful with them.

int i, j, k;

j = 20000;
k = 30000;
i = j + k;
// works if int is 4 bytes
// what will happen if int is 2 bytes?


Question No: 59
What is an Inspection Checklist?

Answer:

Checklist of common errors in a program should be developed and used to drive the inspection process. These
error checklists are programming language dependent such that the inspector has to analyze major constructs of
the programming language and develop checklists to verify code that is written using these checklists.


Question No: 60
Give 2 examples of exceptional code pathes.

Answer:

1... if (e.Title() == “CEO” || e.Salary() > 10000)
operator ==() might throw.

2... cout << e.First() << “ “ << e.Last() << “ is overpaid” << endl;
As per C++ standard, any of the five calls to << operator might throw.




baki bd mein In sha Allah ...! #-o[DOUBLEPOST=1363027261][/DOUBLEPOST]@Don @diya. @ChoCo @yoursks @Prince_Farry @ShyPrincess
 
Top