Karteikarten
Software engi
Karten in diesem Stapel (70)
- 1What is the definition of software engineering?The discipline of software engineering encompasses:
- knowledge,
- tools,
- methods
for defining software requirements, and performing:
- software design,
- software construction,
- software testing,
- software maintenance tasks. - 2Explain the waterfall approach• A linear approach - development stages occur in a sequence
• Well defined set of processes and artefacts for each stage - 3What are 3 advantages to the waterfall approach- Well-managed: provides more confidence
- All requirements are known at the start: easy to measure progress
- A customer presence is not required after the requirements phase - 4What are 3 disadvantages to the waterfall approach- Not flexible: can’t go back to a previous stage and make change
- Too risky: Erroneous/missing requirements not known until deployed
- Requirements can not be changed once the project is started - 5Explain the agile approach- Iterative and incremental approach:
- analysis,
- design,
- coding
- testing
of a small set of requirements in each iteration (usually in weeks)
- Rapid application development and users/clients’ feedback - 6What are 3 advantages to the agile approach• Flexible and adaptive development – allows changes
• Improved quality because of constant users/clients’ feedback
• Team focused – encourages good communication among the team - 7What are 2 disadvantages to the agile approach• Requires commitments from team, users and organization
• Because of multiple iterations, project can go over time and budget - 8What is System analysis• What system should do
• Understanding clients or users’ requirements
• Requires more interactions with them
• Produces System Requirements Specification - 9What is system design• How system works
• Understanding how system is physically implemented
• Requires more interactions with development team – designers, programmers and testers
• Produces System Design Specification
• Provides guidelines to system implementation - 10What are CASE tools• CASE (Computer-Aided Software Engineering) tools are productivity tools for systems analysts that have been created explicitly to improve their routine work through the use of automated support
- 11Why use CASE tools• Increasing Analyst Productivity
• Improving Analyst-User Communication
• Integrating Life Cycle Activities
• Accurately Assessing Maintenance Changes - 12Explain upper CASE tools• Upper CASE support analyst and designers
• Perform analysis and design
• Create and modify the system design
• Help in modeling organizational requirements and defining system boundaries
• Can also support prototyping of screen and report designs - 13Explain lower CASE tools• Lower CASE support programmers and workers who must implement the systems design via Upper CASE.
• Generates source code from CASE design
• Source code is usually generated in several languages - 14Explain integrated CASE tools• Perform both upper and lower CASE functions
- 15Requirements Elicitation• Interviewing users and other stakeholders.
• Distributing and collecting questionnaires.
• Reviewing inputs, outputs, and documentation.
• Observing and documenting business procedures.
• Collecting active user comments and suggestions.
• Joint Application Development (JAD) - Brainstorming - 16What is the difference between Functional and Non-Functional requirements?• Provides what the end-user wants – functional requirements
• Provides good performance – non-functional requirements - 17Object Oriented Analysis and Design• Reusability - recycling of program parts should reduce the costs of development in computer-based systems
• Maintenance - making a change in one object has a minimal impact on other objects
• Analysis - find and describe the objects (or concepts) in the problem domain
• Design - based on the conceptual analysis, define software objects and how they collaborate - 18Unified Modelling Language• The Unified Modeling Language (UML) is an industry standard for modeling object-oriented systems
- 19What is abstraction• Data Abstraction is the property by virtue of which only the essential details are displayed to the user. The trivial or the non-essentials units are not displayed to the user.
Ex: A car is viewed as a car rather than its individual components. - 20What is encapsulation• data encapsulation ensures exclusive data access to class members and protects object integrity by preventing unintended or intended changes.
• data encapsulation also reduces system complexity for increased robustness by limiting interdependencies between software components.
• Data hiding is also known as data encapsulation or information hiding - 21What is inheritance• When a derived class inherits all the attributes and behaviors of the base class (super/parent class)
- 22Why use inheritance• Reduces programming labor by using common objects easily
• Helps to foster reuse
• Helps to maintain existing program code - 23What is polymorphism• Polymorphism is the ability of an object to take on many forms. The most common use of polymorphism in OOP occurs when a parent class reference is used to refer to a child class object.
• Any Java object that can pass more than one IS-A test is considered to be polymorphic. In Java, all Java objects are polymorphic since any object will pass the IS-A test for their own type and for the class Object. - 24What is method overriding• Same method in superclass/subclass relationship
• The subclass method overrides the superclass method
• When attributes or methods are defined more than once, the most specific one is used - 25What is method overloading• Same method names with different signatures in the same class
- 26What is an abstract class?• An abstract class, in the context of Java, is a superclass that cannot be instantiated and is used to state or define general characteristics. An object cannot be formed from a Java abstract class; trying to instantiate an abstract class only produces a compiler error. The abstract class is declared using the keyword abstract.
• Subclasses extended from an abstract class have all the abstract class's attributes, in addition to attributes specific to each subclass. The abstract class states the class characteristics and methods for implementation, thus defining a whole interface. - 27What is an interface in Java?• An interface is a reference type in Java. It is similar to a class. It is a collection of abstract methods. A class implements an interface, thereby inheriting the abstract methods of the interface.
- 28Explain Iterative Software Development• Produces an application through repeated cycles of analysis, design and implementation
- 29Explain the heavyweight methodology and give an example of one• Plan-Oriented
• Detailed Documentation
• Predictive Approach
• Process Oriented
• Tool Oriented
• E.g. Waterfall, Unified Processes (UP), etc. - 30Explain the lightweight methodology and give an example of one• People-Oriented
• Conformance to Outcomes
• Adaptive Approach
• Balancing Flexibility & Planning
• Decentralized Approach
• Limited Team Size
• E.g. eXtreme Programming (XP), SCRUM, etc. - 31What is Unified Process (UP)• It is iterative and incremental
• It is Use Case driven
• It is architecture-centric
• It is risk-focused - 32What are the 4 phases of unified process?• Inception
• Elaboration
• Construction
• transition - 33what is eXtreme Programming (XP)• A lightweight, “developer centric” agile methodology
• Less emphasis on documentation
• More emphasis on:
• customer collaboration
o unit testing
o refactoring
o continuous design - 34what are the 4 values of eXtreme programming?• Communication
• Simplicity
• Courage
• feedback - 35what is SCRUM• Is an agile, lightweight process
• Uses iterative, incremental practices
• Has a simple implementation
• Increases productivity
• Reduces time to benefits
• Embraces adaptive, empirical systems development - 36What is refactoring• It involves changing the code of the system without changing what the system actually does
• Refactoring is used to improve the quality of code making it more understandable and easier to modify - 37Name 6 examples of refactoring• Changing method names
• Breaking long methods into smaller ones
• Moving methods between classes
• Breaking classes up into smaller ones
• Removing classes which don’t pull their weight
• Removing unnecessary temporary variables - 38When to refactor• you refactor because you want to do something else, and refactoring helps you do that other thing
• The rule of three
o You add functionality
do it before you add the new function to make it easier to add the function
or do it after to clean up the code after the function is added
o You need to fix a bug
o You do a code review - 39for each smell in the bloaters group give a description• long method
Signs and Symptoms
- any method longer than ten lines
• Large class
Signs and Symptoms
- A class contains many fields/methods/lines of code.
• Long Parameter List
Signs and Symptoms
- More than three or four parameters for a method.
• Data Clumps
Signs and Symptoms
- Sometimes different parts of the code contain identical groups of variables These clumps should be turned into their own classes. - 40for each smell in the Object-Orientation Abusers group give a description• Refused Bequest
Signs and Symptoms
- If a subclass uses only some of the methods and properties inherited from its parents, the hierarchy is off-kilter. The unneeded methods may simply go unused or be redefined and give off exceptions.
• Alternative Classes with Different Interfaces
Signs and Symptoms
- Two classes perform identical functions but have different method names. - 41for each smell in the Change Preventers group give a description• Divergent Change
Signs and Symptoms
- You find yourself having to change many unrelated methods when you make changes to a class. For example, when adding a new product type you have to change the methods for finding, displaying, and ordering products.
• Shotgun Surgery
Signs and Symptoms
- Making any modifications requires that you make many small changes to many different classes.
• Parallel Inheritance Hierarchies
Signs and Symptoms
- Whenever you create a subclass for a class, you find yourself needing to create a subclass for another class. - 42for each smell in the Dispensables group give a description• Lazy Class
Signs and Symptoms
- Understanding and maintaining classes always costs time and money. So if a class doesn’t do enough to earn your attention, it should be deleted.
• Data Class
Signs and Symptoms
- A data class refers to a class that contains only fields and crude methods for accessing them (getters and setters). These are simply containers for data used by other classes. These classes don’t contain any additional functionality and can’t independently operate on the data that they own.
• Speculative Generality
Signs and Symptoms
- There’s an unused class, method, field or parameter. - 43for each smell in the Couplers group give a description• Feature Envy
Signs and Symptoms
- A method accesses the data of another object more than its own data.
• Inappropriate Intimacy
Signs and Symptoms
- One class uses the internal fields and methods of another class.
• Message Chains
Signs and Symptoms
- In code you see a series of calls resembling $a->b()->c()->d()
• Middle Man
Signs and Symptoms
- If a class performs only one action, delegating work to another class, why does it exist at all? - 44Test Driven Development (TDD)• Iterative and incremental methodology
• Requirements are turned into test cases
• Code is written to pass the test cases
• Test-first coding approach
• Code is written only for failing test cases
• Code is refactored to look simpler & more comprehensible - 45Benefits of TDD• Much less debug time
• Code proven to meet requirements
• Shorter development cycles
• Tests become Safety Net
• Eliminate Bug smell – near zero defects
• Tests are documented - become an asset - 46TDD Steps1. Add a test – related to a feature (one specific feature)
2. Run the test and make sure it fails
3. Write just minimal code to make the test pass
4. Pass all tests – the new test along with other old tests
5. Refactor your code – make simpler & more comprehensible
6. Repeat the cycle – add a new test related to a new feature - 47What 3 traits should a well-designed system have• Are easily understood
• Are simple to modify and extend
• Can be reused - 48Name and explain 7 design smells• Rigidity:
o Hard to change the system because every time you change one thing it forces you to change many other things at the same time
• Fragility:
o If one part of the system changes other unrelated parts of the system break
• Immobility:
o The system is difficult to break up into reusable components
• Viscosity
o It is easier to do things the wrong way than the right way
• Needless Complexity:
o The programmer was preoccupied with being clever and the same tasks could be achieved in a more simple and readable way.
• Needless Repetition:
o Lots of cutting and pasting of code.
• Opacity:
o The code is written in a cryptic fashion making it hard to understand. - 49What are the SOLID principles?• Single Responsibility Principle
• Open Closed Principle
• Liskov Substitution Principle
• Interface Segregation Principle
• Dependency Inversion Principle - 50Explain the first SOLID principle• SRP – A class should have one and only one reason to change
- 51Explain the second SOLID principle• OCP – It should be possible to change the environment of a class without changing the class
- 52Explain the third SOLID principle• LSP – Avoid making methods of derivatives illegal, users of base classes should not need to know about derivatives
- 53Explain the fourth SOLID principle• ISP – Give each user of an object an interface that has just the methods that the user needs
- 54Explain the fifth SOLID principle• DIP – Depend on interfaces and abstract classes instead of volatile concrete classes
- 55What is the purpose of a design pattern?• Design Patterns communicate solutions to common programming problems
- 56How do design patterns solve design problems• Finding Appropriate Objects
• Determining Object Granularity
• Specifying Object Interfaces
• Specifying Object Implementations - 57What 6 traits must a design pattern adhere to• SMART - an elegant solution not obvious to a novice
• GENERIC - not dependent upon a system, programming language or application domain
• WELL-PROVEN - has been identified from real OO systems
• SIMPLE - is usually quite small, involving only a handful of classes
• REUSABLE - is documented in such a fashion that it is easy to reuse
• OBJECT-ORIENTED - built with OO mechanisms such as classes, objects, generalization and polymorphism - 58What are the three categories of design patterns?• Creational – concerned with how objects are created
• Structural – concerned with how object fit together
• Behavioural – concerned with the functionality of objects - 59Guiding principle design pattern• Programming to an Interface, not an Implementation
- 60What is an Model-View-Controller (MVC)?• The Model is the actual internal representation
• The View (or a View) is a way of looking at or displaying the model
• The Controller provides for user input and modification
• These three components are usually implemented as separate classes - 61What is a creational pattern?• Abstract the instantiation process
• Help make a system independent of how its objects are created, composed, and represented
• Two recurring themes in these patterns
• Encapsulate knowledge about which concrete classes the system uses
• Hide how instances of these classes are created and put together
• Give a lot of flexibility in what gets created, who creates it, how it gets created, and when - 62which creational patterns were covered during the course?• Factory pattern
• Factory method pattern*
• Singleton pattern - 63For 2 of the creational pattern listed explain the context/problem and the solution• Factory
o Context/Problem
o Who should be responsible for creating objects when there are special considerations, such as complex creation logic, a desire to separate the creation responsibilities for better cohesion, and so forth?
o Solution
o Create a dedicated object called a Factory that handles the creation
• Singleton
o Context/Problem
o At most one instance of a class is allowed – it is a “singleton”. Objects need a global and single point of access
o Solution
o Define a static method of the class that returns the singleton - 64What is a structural pattern?• Concerned with how classes and objects are composed to form larger structures
• Describe ways to compose objects to realize new functionality
• Flexibility of object composition comes from the ability to change the composition at run-time, which is impossible with static class composition - 65which structural patterns were covered during the course?• Adapter pattern
• Decorator pattern
• Façade pattern - 66Explain each structural pattern listed• Adapter
o Convert the interface of a class into another interface clients expect. Adapter lets classes work together that couldn't otherwise because of incompatible interfaces.
o The adapter pattern is also known as a “wrapper”
o When to use:
you want to use an existing class, and its interface does not match the one you need.
you want to create a reusable class that cooperates with unrelated or unforeseen classes, that is, classes that don't necessarily have compatible interfaces.
• Decorator
o The decorator pattern attaches additional responsibilities to an object dynamically. Decorators provide a flexible alternative to sub-classing for extending functionality.
• Façade
o The Façade Pattern provides a unified interface to a set of interfaces in a subsystem. Façade defines a higher level interface that makes the subsystem easier to use. - 67What is a Behavioural pattern?• Concerned with algorithms and the assignment of responsibilities between objects
• Describe not just patterns of objects or classes but also the patterns of communication between them
• Characterize complex control flow that's difficult to follow at run-time
• Shift your focus away from flow of control to let you concentrate just on the way objects are interconnected - 68which Behavioural patterns were covered during the course?• Command Pattern
• State Pattern
• Strategy Pattern - 69For 3 of the Behavioural patterns listed explain the context/problem and the solution also/or explain• Command
o Context/Problem
o Sometimes it's necessary to issue requests to objects without knowing anything about the operation being requested or the receiver of the request.
o Solution
o Encapsulate a request as an object, thereby letting you parameterize clients with different requests, queue or log requests, and support undoable operations.
o Explain
o Allows methods to be encapsulated in objects and invoked by a standard means as determined by the interface of the common class
• State
o A class hierarchy is defined around a set of states for an object, allowing the behavior of an object to vary depending on a state by substituting the state-specific subclass in its composition
• Strategy
o The Strategy pattern involves removing an algorithm (strategies) from its host class and putting it in a separate class. - 70What is the difference between state and strategy patterns?• State
• Encapsulate state-based behaviour and delegate behavior to the current sate
• Strategy
• Encapsulate interchangeable behaviours and use delegation to decide which behavior to use.
Informationen
- Beschreibung
- Karteikarten am Software engi , erstellt von Andre Clark am 17/11/2019.
- Erstellt von
- Andre Clark
- Aufrufe
- 7
- Bewertung