Tuesday, June 10, 2014

Vi ---> Saving and Quitting

     :w    write to disk
     ZZ    write to disk and exit
     :q!   exit without writing to disk

Actually, the command for quitting vi is :q. You can save and quit by typing :wq but ZZ does the same thing1 and takes one less keystroke. If there are unsaved changes to the text and you try to quit using :qvi will warn you that you have unsaved changes and will prevent you from quitting. In order to quit without saving the changes you must use the override switch, !.

Vi ---> Deleting text

x     delete the character under the cursor
dd    delete a line

Vi ---> Moving around

     h         move the cursor one character to
               the left
     j         move the cursor one character down
     k         move the cursor one character up
     l         move the cursor one character to
               the right
     0         move to the beginning of a line
     $         move to the end of a line
     G         move to the end of a file
     1G        move to the first line of a file
     <ctrl-F>  move down one screen
     <ctrl-B>  move up one screen

UNIX Vi ---> Search and Replace

The search command is /. To search for polite type /politen repeats the search in the same direction, and N repeats the search in the opposite direction.
The search option accepts most of the standard Unix pattern matching language.

Here are a few examples (using this text) that you will probably never use but may find inspiring:

    /[a-z]as
will search for any lowercase letter followed by as. In this example, it would find was and last but not as or asked.

    /[^c]an
will search for any an preceded by any character other than a c. In our text it would find Milan but not scan or can.

    /^[A-Z].*\. *$
will search for any line that begins with a capital letter and ends with a period and any number of blanks. Our only match in the example text would be with the last line.
All of these search patterns can be used in the search and replace command that takes on the following structure:

    :s/search_string/replacement_string/g
This command replaces every search_string on the current line with replacement_string. Omitting the g (global) flag at the end of the command will cause only the first occurrence of search_string to be altered. Often you may wish to confirm each replacement. This can be done with the confirm flag c. The confirm flag should be placed after or in place of the g flag. Suppose I had the following line:
Give a skeptic and inch... and he'll take a mile.
and typed

    :s/take a mile/measure it/
I would be left with
Give a skeptic and inch... and he'll measure it.

Any command that begins with a ":" is called a line mode command and performs its duty on the line the cursor is currently on. However, you can override vi's default of operating only on the current line by preceding them with a range of line numbers. For example, if I wanted to replace guy with gal on lines 32 through 56 I would type

    :32,56s/guy/gal/g
Omitting the g would cause only the first occurrence of guy in each line to be replaced. The "." and "$" play a special role in this sort of designation. "." indicates the current line, and "$" indicates the last line of the file. Therefore, if I wanted to delete1 from the current line to the end of the file I would enter:2

    :.,$d
I could even do something like:

    :.,/Edison/d
which would delete from the current line to the next line that contained Edison.
One other shortcut that might be worth mentioning is that 1,$ and % both indicate all the lines in the file. Therefore,

    :1,$s/search_string/replacement_string/g
and

    :%s/search_string/replacement_string/g
do exactly the same thing.

Sunday, May 19, 2013

Testing FAQ

1. What is Black box testing?
Answer: Black box testing is the testing of requirements and functionality without knowledge in internal content. Inputs are fed into the system and outputs are determined expected or unexpected
 2. What is white box testing?
Answer: White box testing is testing based on knowledge of the internal logic (algorithms) of an application’s code. Its an approach that attempts to cover the software’s internals in detail. White box testing is also known as ‘glass box testing’, ‘clear box testing’, ‘transparent box testing’ and ‘structural testing’
 3. What is grey box testing?
Answer: Grey box testing uses a combination of black and white box testing. Grey box test cases are designed with knowledge of the internal logic (algorithms) of an application’s code but the actual testing is performed as black box. Alternately a limited number of white box testing is performed followed by conventional black box testing
 4. What is unit testing?
Answer: Unit testing is the testing of the smallest units of code such as functions. Typically unit testing is performed by the developer and not by testers. It requires knowledge of the internal program’s organization and code. Unit testing may not be easily performed as independent testable components may be difficult to isolate for testing. Some unit testing may require building a driver module to be built. Typically unit testing documentation is minimal if it is documented at all. Unit testing is also known as component testing
 5. What is integration testing?
Answer: Integration testing consists of integrating components (units) of a software design to verify that the components are working well together. Typically tested software modules (units) are integrated progressively until the entire integrated system (software design) is complete
 6. What is system testing?
Answer: System testing verifies that an integrated system (independent of third party systems) meets requirements.
  7. What is System integration testing?
Answer: System integration testing verifies the satisfactory integration of the completed and tested system with external systems (if any).
 8. What is regression testing?
Answer: Regression testing consists of testing for software regressions. Typically regression testing is performed after changes have been made to a preciously released version of the software. The point is to discover any knock on effects (side effects) of having modified the software. Modifications to a system can produce collateral damage such as conflicts within the system, performance issues or reemergence of old previously closed bugs.

9. What is acceptance testing?
Answer: Acceptance testing is typically by the customer performed usually on site on their designated test system. Acceptance testing is also known as user acceptance testing (UAT). Typically this is the last phase of testing before the software is released to the client,
11. What is a trace-ability matrix?
Answer: A trace-ability matrix is a document cross referencing requirements and test points in a test case. The point is the have sufficient test cases to cover all of the requirements
12. What is a Moscow list?
Answer: MoSCoW is an acronym for Must, Should, COuld, Would. It essentially is a priority checklist. When discussing system requirements with the users a MoSCoW list may be used to help prioritize requirements to determine which are most critical.
13. What is a smoke test?
Answer: A smoke test is a quick and dirty test to determine quickly the status of a system. It is used to reveal simple failures severe enough to reject a prospective software release. The smoke test once successful is followed by further testing,
14. What is stability testing?
Answer: Stability testing is performed to determine if a software system is stable over time. Typically a period of time is targeted. A memory leak is a an example of the type of problem that could destabilize a software system over time.
15. What is Usability testing?
Answer: Usability testing consists of testing that the user interface (GUI) is simple to understand , intuitive , consistent and optimized for power users.

16. What is security testing?
Answer: Security testing consists of determining if the system authentication is functional, the system protects data and the system is resistant to hackers
17. What is Scalability testing?
Answer: Scalability testing consists of determining if the system can be scaled up in terms of load supported, the number of transactions, the data volume etc. This can also be classified as performance testing and non-functional testing
18. What is Reliability testing?
Answer: Reliability testing consists of determining the ability of a system or component to perform its required functions under stated conditions for a specified period of time. This can also be classified as performance testing and non-functional testing
19. What is compatibility testing?
Answer: compatibility testing consists of determining the application’s compatibility with the computing environment. Is the application compatible with the hardware (PC, Mac, IBM 360) , peripherals (printer, modem, scanner), operating system (UNIX, Linux, Windows 7, Windows vista), database (oracle, sql server), browser(Firefox ,Opera IE) etc.. This can also be classified as non-functional testing
20. What is Concurrency testing?
Answer: Concurrency testing consists of determining if the system can successfully handle concurrent threads and users. Testing with concurrent users might also include testing concurrent access to a database row.
21. What is Code coverage?
Answer: Code coverage consists of determining percentage of a system’s code that is being verified by a test(s).
22. What is a Sprint?
Answer: A Sprint is the basic unit of development in Agile Scrum development. It is a time box of effort directed towards a specific goal which is a subset of a greater effort and goal. A typical sprint lasts about 3-4 weeks

23. What is a Test stub?
Answer: A test stub is an bit of code that replaces an undeveloped or fully developed component within a system being tested. The test stub is built such that it mimics the actual component by generating specific known outputs. The stub can be used as a substitute for the actual (fully developed) component for testing purposes. The stub can also be used during testing to isolate system components and troubleshoot problems. A test stub is also known as a test double.
  
24. What is a Test-Driven Development (TDD) ?
Answer: Test-Driven Development (TDD) is a development methodology whereby the developer writes a unit test as a starting point and then writes code that will allow the test to pass. The development of the entire system proceeds one test at a time. Further Info: Test-Driven Development (TDD)
 25. What is a story board ?
Answer: A Story board is a visual representation of a software project’s progress. There are generally four columns ‘To do’, ‘In Progress’,'Test’,” and ‘Done’. Different colored post It notes are placed in each column indicating the progress of individual development items. A story board is typically used in agile development.
  26. What is a Release candidate ?
Answer: A Release candidate is a build or version of a software that can be released to production. Further testing such as UAT may be performed on this version of the product.
 27. What is Re-factoring ?
Answer: Re-factoring is modifying existing code to improve its performance, readability,extensibility etc. The code’s functionality remains as is .
 28. What is an epic ?
Answer: An epic is an agile term for a customer described software feature that is itemized in the product backlog. Epics are subdivided into stories.
 29. What is functional test ?
Answer: A functional test is a type of black box test that based on the specifications of the software object being tested. Functions are tested by inputting known values and examining the output
 30. What is a business facing test ?
Answer: A business facing test can be explained in terms recognizable the subject matter expert using words from the business domain. Example: when an item is placed in cart the sales tax is automatically added. Technology facing tests in contrast can be explained in technical terms not necessarily understood by the subject matter expert. When an item is purchased a cookie is set on the client computer.
 32. What is a use case ?
Answer: A use case is a software modeling technique. A description or a diagram (use case diagram) of a user’s (actor) useful actions on a theoretical software system is created for the purpose of modeling the the software . A useful action is one that achieves a specific goal. Further Info: Use case

What is UML ?
Answer: UML is an acronym for Unified modeling language. UML is a graphical Object oriented software modeling language.The visual models or artifacts include but are not limited to: sequence diagram, activity diagram, class diagram, object diagram, use case diagram, state machine diagram Further Info: UML

34. What is a boundary testing ?
Answer: Boundary testing also known as boundary value analysis is verifying the upper (and just above) and lower (and just below) limits of the input domain. A boundary value analysis test case would input into a function, values that meet the above mentioned criterion