Software Engineering Flashcards
Learn for Exam (68 cards)
What is involved in software dev?
Maintaining CodeBase
What is the benefit of improving code?
More readable, pays off in the long term
No Technical Debt
What are some aspects of code quality?
Readability, Indentation, Function Names, Variable names, consistency of codebase
What should good naming achieve?
Adding Semantic Info
Making it clear what does what
What is the purpose of comments?
Explain what the code does,
Limits technical knowledge required,
What is Refactoring?
Rewriting parts of the codebase,
Doesn’t chaneg functionality,
Improve Readability
What is pair programming?
Two devs working together,
Communicating enforces clear logic + comments
What are code reviews?
Review of a dev’s code by other team members
What are some automated code review checks?
Style checks (indentation, spacing, naming)
Compiler Warnings (Some programming languages provide warnings - variable not used)
How do we classify Errors?
By different types,
How the error is introduced,
How we find the error
How can errors be introduced?
Mistakes - wrong logic,
Failure - logic implemented badly,
Syntax Errors
Hardware Malfunction
What are the different ways in which we find out about errors?
Static Error - When developing
Immediate runtime error - When program starts
Latent runtime error - Sometime during program execution
What are errors in subroutines?
Input Error - Operation fails because of invalid inputs
Output Error - No way of producing valid result
What are good practises when apporaching errors?
Assume they will happen,
Make it easy to discover
What is the engineering approach to errors?
That errors are inevitable, we cannot check everything due to time + budget
How do we indicate errors?
Int method - return null or -1
Exception method - throw exception
Do modern applications prefer int or exception error methods?
Exceptions - Cannot be confused with a valid result
- Name explains reason for error
How to handle bad inputs?
Ignore bad inputs - assume input is valid
Fail when input is bad - Terminate execution
What is defensive programming?
Assume that functions may not be called correctly
Protect code with exceptions
Security measures in low level code
Check for null values explicitly
What is test-based engineering approach to errors?
Prevent errors using tests
Tests are methods for checking correctness
Tests are lightweight specifications
What is TDD?
Test driven development - Writing tests first and then the code that satisfies the tests
When do we use branching?
you own the repo,
small private projects,
Progress visible in main
When do we use forking
You don’t own the repo,
Open Source,
Large scale tests in your version
Large enterprise projects
What is the waterfall approach
Gather Requirements
Analyse + Design
Programming
Testing
Deployment