Week 1 review Flashcards

1
Q

What is the difference between a client and a server?

A

A client is a program, or machine, that sends requests to servers. For example, a personal computer. A client is typically a general purpose computer. A server is specialized for serving data to clients via request and response. Servers share data and resources often to several clients at once. They are typically more powerful and more expensive than client machines. Types of servers include application servers, database servers, file servers, print servers, etc. Typically, servers are Linux based.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is an operating system?

A

System software that manages computer hardware, software resources, and provides common services for computer programs. The operating system acts as an intermediary between programs and computer hardware for functions such as input/output and memory allocation. Windows is by far the most widespread OS followed by Apple and Linux.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are some common Client Operating Systems?

A

Windows, macOS, Linux

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does it mean to be Open Source?

A

Source code that is made freely available for possible modification and distribution. The open-source model is a decentralized software development model that encourages open collaboration. A main principle of open-source software development is peer production, with products such as source code, blueprints, and documentation freely available to the public. The open-source movement in software began as a response to the limitations of proprietary code. The model is used for projects such as in open-source appropriate technology, and open-source drug discovery. Linux is an example of an open source operating system whereas Windows and macOS requires a license.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Why would a server want to run an open source operating system?

A

Free and available as open source software.You can easily see the code available that was used for creating the Linux Kernel and also modify the code to fix any bugs etc. And you can even develop your own programs and add it to the Linux OS as it provides you with many programming interfaces. With so many features, you can customize the operating system to suit your requirement which is not possible with Windows.
Stability: Linux systems are renowned for their ultimate stability as they can run continuously for years without any major issues.
Security: When it comes to security, Linux is obviously more secure than Windows as Linux is largely based on the UNIX operating system which was originally developed from the beginning to a multiuser operating system.
Maintenance is cheaper. Freedom from products and services. Flexibility to install whatever you want.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is Version Control and why is it valuable?

A

Version control systems allow multiple developers, designers, and team members to work together on the same project. It helps them work smarter and faster! A version control system is critical to ensure everyone has access to the latest code and modifications are tracked. As development becomes increasing complex and teams grow, there’s a bigger need to manage multiple versions and components of entire products.
Version control is important to keep track of changes — and keep every team member working on the right version. You should use version control software for all code, files, and assets that multiple team members will collaborate on.
It needs to do more than just manage and track files. It should help you develop and ship products faster. This is especially important for teams practicing DevOps.
That’s because using the right one:
Improves visibility.
Helps teams collaborate around the world.
Accelerates product delivery.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is Git?

A

Git (/ɡɪt/) is version control software for tracking changes in any set of files, usually used for coordinating work among programmers collaboratively developing source code during software development. Its goals include speed, data integrity, and support for distributed, non-linear workflows (thousands of parallel branches running on different systems).
Strong support for non-linear development
Git supports rapid branching and merging, and includes specific tools for visualizing and navigating a non-linear development history. In Git, a core assumption is that a change will be merged more often than it is written, as it is passed around to various reviewers. In Git, branches are very lightweight: a branch is only a reference to one commit. With its parental commits, the full branch structure can be constructed.
Distributed development
Like Darcs, BitKeeper, Mercurial, Bazaar, and Monotone, Git gives each developer a local copy of the full development history, and changes are copied from one such repository to another. These changes are imported as added development branches and can be merged in the same way as a locally developed branch.
Compatibility with existent systems and protocols
Repositories can be published via Hypertext Transfer Protocol (HTTP), File Transfer Protocol (FTP), or a Git protocol over either a plain socket or Secure Shell (ssh). Git also has a CVS server emulation, which enables the use of existent CVS clients and IDE plugins to access Git repositories. Subversion repositories can be used directly with git-svn.[43]
Efficient handling of large projects
Torvalds has described Git as being very fast and scalable,[44] and performance tests done by Mozilla[45] showed that it was an order of magnitude faster than some version-control systems; fetching version history from a locally stored repository can be one hundred times faster than fetching it from the remote server.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a Git Hosting Provider and what are some examples?

A
“A web hosting service is a type of Internet hosting service that hosts websites for clients, i.e. it offers the facilities required for them to create and maintain a site and makes it accessible on the World Wide Web”. GitHub/GitLab etc. – hosting services, allow you to host projects that use Git. They have all the functions of the Git engine and various other additional features.
Bitbucket.
GitLab.
Perforce.
Beanstalk.
Amazon AWS CodeCommit.
Codebase.
Microsoft Azure DevOps.
SourceForge.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are some common Git Commands?

A

Git clone. Git clone is a command for downloading existing source code from a remote repository (like Github, for example). …
Git branch. Branches are highly important in the git world. …
Git init
Git add. …
Git commit. …
Git checkout. …
Git status. …
Git push. … ($ git push ) [git push -u origin feature]
for another branch : git push : –allow-unrelated-histories

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Steps to push to remote Git repository:

A

These are the five steps to successfully perform a git remote add origin and push to a remote repository:

  1. Validate the existence of your local Git repository.
  2. Create a new, empty Git repository on your remote server.
  3. Obtain the git remote add URL for the remote repository and add credentials if needed.
  4. Run the git remote add origin command from your local repository with the –set-upstream and the name of the active branch to push.
  5. View the pushed files on the remote Git repository to verify that the git remote add and push commands ran successfully.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is upstream branch?

A

*Upstream branches are the branches on the remote repository that are tracked by a local remote branch in the local repository

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is programming?

A

A: Computer programming is the process of performing a particular computation (or more generally, accomplishing a specific computing result), usually by designing and building an executable computer program. Programming involves tasks such as analysis, generating algorithms, profiling algorithms’ accuracy and resource consumption, and the implementation of algorithms (usually in a chosen programming language, commonly referred to as coding). The source code of a program is written in one or more languages that are intelligible to programmers, rather than machine code, which is directly executed by the central processing unit. The purpose of programming is to find a sequence of instructions that will automate the performance of a task (which can be as complex as an operating system) on a computer, often for solving a given problem. Proficient programming thus usually requires expertise in several different subjects, including knowledge of the application domain, specialized algorithms, and formal logic.

Tasks accompanying and related to programming include testing, debugging, source code maintenance, implementation of build systems, and management of derived artifacts, such as the machine code of computer programs. These might be considered part of the programming process, but often the term software development is used for this larger process with the term programming, implementation, or coding reserved for the actual writing of code. Software engineering combines engineering techniques with software development practices. Reverse engineering is a related process used by designers, analysts, and programmers to understand and re-create/re-implement.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is control flow?

A

A: In computer science, control flow (or flow of control) is the order in which individual statements, instructions or function calls of an imperative program are executed or evaluated. The emphasis on explicit control flow distinguishes an imperative programming language from a declarative programming language.

Within an imperative programming language, a control flow statement is a statement that results in a choice being made as to which of two or more paths to follow. For non-strict functional languages, functions and language constructs exist to achieve the same result, but they are usually not termed control flow statements.

A set of statements is in turn generally structured as a block, which in addition to grouping, also defines a lexical scope.

Interrupts and signals are low-level mechanisms that can alter the flow of control in a way similar to a subroutine, but usually occur as a response to some external stimulus or event (that can occur asynchronously), rather than execution of an in-line control flow statement.

At the level of machine language or assembly language, control flow instructions usually work by altering the program counter. For some central processing units (CPUs), the only control flow instructions available are conditional or unconditional branch instructions, also termed jumps.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are some common Control Flow Statements in Java?

A
A: Java provides three types of control flow statements.
Decision Making statements
if statements
switch statement
Loop statements
do while loop
while loop
for loop
for-each loop
Jump statements
break statement
continue statement
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the entry point for any Java application and what is the syntax for writing it?

A

Main method:

    public static void main(String[] args) {
   {
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are annotations in Java?

A

Annotations are used to provide supplemental information about a program.
Annotations start with ‘@’. Example: @Override @ Deprecated @Inherited
Annotations do not change the action of a compiled program.
Annotations help to associate metadata (information) to the program elements i.e. instance variables, constructors, methods, classes, etc.
Annotations are not pure comments as they can change the way a program is treated by the compiler. See below code for example.
Annotations basically are used to provide additional information, so could be an alternative to XML and Java marker interfaces.

17
Q

What is a Method in Java

A

A method is a block of code or collection of statements or a set of code grouped together to perform a certain task or operation. It is used to achieve the reusability of code. We write a method once and use it many times. We do not require to write code again and again. It also provides the easy modification and readability of code, just by adding or removing a chunk of code. The method is executed only when we call or invoke it.
The most important method in Java is the main() method.

18
Q

What is a Method Parameter?

A

Arguments in Java are the actual values that are passed to variables defined in the method header when the method is called from another method.
That is, whenever any particular method is called during the execution of the program, there are some values that are passed to call that particular method. These values are called arguments.
The passed argument values replace those parameters which have been used during method definition and the body of method is then executed with these values.
The type of argument values passed must be matched with the type specified for the corresponding parameter in the definition of method. Sometimes, an argument is also called actual parameter.

19
Q

What is a Constructor?

A
A constructor in Java is a special method that is used to initialize objects. The constructor is called when an object of a class is created. It can be used to set initial values for object attributes. 
In Java, a constructor is a block of codes similar to the method. It is called when an instance of the class is created. At the time of calling the constructor, memory for the object is allocated in the memory. It is a special type of method which is used to initialize the object. Every time an object is created using the new() keyword, at least one constructor is called.
How Constructors are Different From Methods in Java? 
Constructors must have the same name as the class within which it is defined while it is not necessary for the method in Java.
Constructors do not return any type while method(s) have the return type or void if does not return any value.
Constructors are called only once at the time of Object creation while method(s) can be called any number of times.
When is a Constructor called? 

Each time an object is created using a new() keyword, at least one constructor (it could be the default constructor) is invoked to assign initial values to the data members of the same class.

The rules for writing constructors are as follows:
Constructor(s) of a class must have the same name as the class name in which it resides.
A constructor in Java can not be abstract, final, static, or Synchronized.
Access modifiers can be used in constructor declaration to control its access i.e which other class can call the constructor.
20
Q

What is a Unit Test and why is it valuable?

A

Unit testing is a software testing method where “units”—the individual components of software—are tested. Developers write unit tests for their code to make sure that the code works correctly. This helps to detect and protect against bugs in the future.

Some developers underestimate the importance of writing unit tests. What follows are five benefits of unit testing that you may want to consider before forming your own opinion.
Any bugs are found easily and quicker
Code covered with tests is more reliable than the code without. 
Unit testing saves time and money 
Unit testing provides documentation
R2: Reusable and Reliable
Unit testing helps gauge performance
Unit testing improves code coverage 
Unit testing reduces code complexity
UNIT TESTING RESULTS IN QUALITY SOFTWARE
21
Q

What is TDD?

A

Test-driven development (TDD) is a software development process relying on software requirements being converted to test cases before software is fully developed, and tracking all software development by repeatedly testing the software against all test cases. This is as opposed to software being developed first and test cases created later.

Software engineer Kent Beck, who is credited with having developed or “rediscovered”[1] the technique, stated in 2003 that TDD encourages simple designs and inspires confidence.[2]

Test-driven development is related to the test-first programming concepts of extreme programming, begun in 1999,[3] but more recently has created more general interest in its own right.[4]

Programmers also apply the concept to improving and debugging legacy code developed with older techniques.[

Setup: Put the Unit Under Test (UUT) or the overall test system in the state needed to run the test.
Execution: Trigger/drive the UUT to perform the target behavior and capture all output, such as return values and output parameters. This step is usually very simple.
Validation: Ensure the results of the test are correct. These results may include explicit outputs captured during execution or state changes in the UUT.
Cleanup: Restore the UUT or the overall test system to the pre-test state. This restoration permits another test to execute immediately after this one. In some cases, in order to preserve the information for possible test failure analysis, the cleanup should be starting the test just before the test’s setup run. [6]
A 2005 study found that using TDD meant writing more tests and, in turn, programmers who wrote more tests tended to be more productive.[10] Hypotheses relating to code quality and a more direct correlation between TDD and productivity were inconclusive.[11]

Programmers using pure TDD on new (“greenfield”) projects reported they only rarely felt the need to invoke a debugger. Used in conjunction with a version control system, when tests fail unexpectedly, reverting the code to the last version that passed all tests may often be more productive than debugging.[12]

22
Q

What is an assertion?

A

An assertion is a statement in the Java programming language that enables you to test your assumptions about your program. For example, if you write a method that calculates the speed of a particle, you might assert that the calculated speed is less than the speed of light.

23
Q

What are the steps for the Red/Green testing process?

A

The Red, Green, Refactor method consists of three phases:
Red - write a test that fails.
Green - implement the test-supporting functionality to pass the test.
Refactor - improve the production code AND the tests to absolute perfection.

24
Q

What is JUnit

A

JUnit is a unit testing open-source framework for the Java programming language. Java Developers use this framework to write and execute automated tests. In Java, there are test cases that have to be re-executed every time a new code is added. This is done to make sure that nothing in the code is broken.
JUnit has several graphs that represent the progress of a test. When the test runs smoothly, the graph displays a green color, and it turns red if the test fails. JUnit Testing enables developers to develop highly reliable and bug-free code.

25
Q

What are some common JUnit Annotations?

A
@Test. This annotation denotes that a method is a test method. ...
@ParameterizedTest. Parameterized tests make it possible to run a test multiple times with different arguments. ...
@DisplayName. ...
@BeforeEach. ...
@AfterEach. ...
@BeforeAll. ...
@AfterAll. ...
@Tag.
26
Q

What is the static keyword in Java?

A

In the Java programming language, the keyword static means that the particular member belongs to a type itself, rather than to an instance of that type. This means we’ll create only one instance of that static member that is shared across all instances of the class.