Practicle
Practicle
S Title Signature
.No
1 To understand the Execution and Compilation of
program.
2 HTML Practice using HTML forms and other
elements.
3 CSS Practice using Inline, External & Internal CSS.
The Python interpreter processed the script in a sequential manner. Then the
code is compiled into a form of instruction set called the byte code. Byte code
is a low level language. It is an intermediate, machine independent code
which optimizes the process of code execution.
Python Programming:
o It is very popular and open source programming language.
o It is easy to learn.
o Can be used on a server to create web applications:
Software development.
Mathematics
System scripting
o Simple and effective approach to oops.
JIT( Just-In-Time ):
COMPILER INTERPRETER
Steps of Programming: Steps of Programming:
Program Creation. Program Creation.
Analysis of language by the Linking of files or generation of
compiler and throws errors in case Machine Code is not required by
of any incorrect statement. Interpreter.
In case of no error, the Compiler Execution of source statements
converts the source code to one by one.
Machine Code.
Linking of various code files into a
runnable program.
Finally runs a Program
The compiler saves the Machine The Interpreter does not save the
Language in form of Machine Code Machine Language.
on disks.
The compiler generates an output in The interpreter does not generate any
the form of (.exe). output.
Errors are displayed in Compiler after Errors are displayed in every single
Compiling together at the current line.
time.
Object code is permanently saved for No object code is saved for future
future use. use.
C, C++, C#, etc are programming Python, Ruby, Perl,
languages that are compiler-based SNOBOL, MATLAB, etc are
programming languages that are
interpreter-based
Compilation:
A special application called a compiler, executes our Java program on what is
known as a virtual Java machine (JVM).
The compiler transforms source code into so-called JVM bytecode, or machine
code read by JVM. In addition, the compiler should check the code for lexical and
semantic issues and optimise it.
Interpretation:
Interpretation is the process of analyzing machine code and running it. The
interpreter is a unique program that does these tasks.
JVM (Java Virtual Machine)
JVM stands for Java Virtual Machine. It is software that provides a runtime
environment to execute Java code or other programming languages that target the
JVM.
The JVM is responsible for interpreting and executing Java bytecode, which is a
compiled version of the Java source code.
Some popular JVM languages include Java, Kotlin, Scala, and Groovy. The JVM is
widely used in enterprise software development, web development, and mobile app
development.
PRACTICLE- 2
Structure explain:
The <!DOCTYPE html> declaration defines that this document is an HTML5 document
The <html> element is the root element of an HTML page
The <head> element contains meta information about the HTML page
The <title> element specifies a title for the HTML page (which is shown in the
browser's title bar or in the page's tab)
The <body> element defines the document's body, and is a container for all the visible
contents, such as headings, paragraphs, images, hyperlinks, tables, lists, etc.
The <h1> element defines a large heading
The <p> element defines a paragraph
The HTML element is everything from the start tag to the end tag:
<h1>My First Heading</h1>
<p>My first paragraph.</p>
Note: Some HTML elements have no content (like the <br> element). These
elements are called empty elements. Empty elements do not have an end tag!
HTML Attributes
All HTML elements can have attributes
Attributes provide additional information about elements
Attributes are always specified in the start tag
Attributes usually come in name/value pairs like: name="value"
Example
<a href="https://www.webprogramins.com">Visit web programing</a>
Example
<img src="img_girl.jpg">
Example
<img src="img_girl.jpg" width="500" height="600">
Example
<img src="img_girl.jpg" alt="Girl with a jacket">
The lang Attribute
You should always include the lang attribute inside the <html> tag, to declare the language of
the Web page. This is meant to assist search engines and browsers.
<!DOCTYPE html>
<html lang="en">
<body>
...
</body>
</html>
HTML Headings
HTML headings are titles or subtitles that you want to display on a webpage.
<h1> defines the most important heading. <h6> defines the least important heading.
Example
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
HTML Paragraphs
The HTML <p> element defines a paragraph.
A paragraph always starts on a new line, and browsers automatically add some white space
(a margin) before and after a paragraph.
Example
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
Practical-3
What is CSS?
CSS stands for Cascading Style Sheets. It is a style sheet language used to describe the
presentation and formatting of a document written in HTML or XML. CSS is used to control
the visual appearance of web pages and user interfaces in various applications.
With CSS, you can define styles for elements such as text, images, backgrounds, borders,
spacing, and layout. It allows you to control the colors, fonts, sizes, positioning, and other
visual aspects of the elements on a web page. By separating the content (HTML) from its
presentation (CSS), web developers can create consistent styles across multiple pages and
easily make changes to the appearance of a website.
CSS uses a selector mechanism to target specific elements in an HTML document and apply
styles to them. Selectors can target elements by their tag name, class, ID, or other
attributes.CSS rules consist of a selector and a declaration block enclosed in curly braces.
Within the declaration block, you define the styles using property-value pairs.
For example, the following CSS code sets the color and font size for all paragraphs in an
HTML document:
First, let's examine three methods of applying CSS to a document: with an external stylesheet, with an
internal stylesheet, and with inline styles.
External stylesheet
An external stylesheet contains CSS in a separate file with a .css extension. This is the most
common and useful method of bringing CSS to a document. You can link a single CSS file to
multiple web pages, styling all of them with the same CSS stylesheet. In the Getting started with
CSS, we linked an external stylesheet to our web page.
An internal stylesheet resides within an HTML document. To create an internal stylesheet, you
place CSS inside a <style> element contained inside the HTML <head>.
Inline styles are CSS declarations that affect a single HTML element, contained within
a style attribute. The implementation of an inline style in an HTML document might look like this:
Avoid using CSS in this way, when possible. It is the opposite of a best practice. First, it is the least
efficient implementation of CSS for maintenance. One styling change might require multiple edits
within a single web page. Second, inline CSS also mixes (CSS) presentational code with HTML and
content, making everything more difficult to read and understand. Separating code and content
makes maintenance easier for all who work on the website.
There are a few circumstances where inline styles are more common. You might have to resort to
using inline styles if your working environment is very restrictive. For example, perhaps your CMS
only allows you to edit the HTML body. You may also see a lot of inline styles in HTML email to
achieve compatibility with as many email clients as possible.
Properties and values
Properties: These are human-readable identifiers that indicate which stylistic features
youwant to modify. For example, font-size, width, background-color.
Values: Each property is assigned a value. This value indicates how to style the property.
The example below highlights a single property and value. The property name is color and the value
is blue.
When a property is paired with a value, this pairing is called a CSS declaration. CSS declarations
are found within CSS Declaration Blocks. In the example below, highlighting identifies the CSS
declaration block.
Finally, CSS declaration blocks are paired with selectors to produce CSS rulesets (or CSS rules).
The example below contains two rules: one for the h1 selector and one for the p selector. The
colored highlighting identifies the h1 rule.
Setting CSS properties to specific values is the primary way of defining layout and styling for a
document. The CSS engine calculates which declarations apply to every single element of a page.
CSS properties and values are case-insensitive. The property and value in a property-value pair are
separated by a colon (:).
What is Bootstrap?
Bootstrap is a free front-end framework for faster and easier web development
Bootstrap includes HTML and CSS based design templates for typography, forms,
buttons, tables, navigation, modals, image carousels and many other, as well as
optional JavaScript plugins
Bootstrap also gives you the ability to easily create responsive designs
Bootstrap History
Bootstrap was developed by Mark Otto and Jacob Thornton at Twitter, and released as an
open source product in August 2011 on GitHub.
Easy to use: Anybody with just basic knowledge of HTML and CSS can start using
Bootstrap
Responsive features: Bootstrap's responsive CSS adjusts to phones, tablets, and
desktops
Mobile-first approach: In Bootstrap 3, mobile-first styles are part of the core
framework
Browser compatibility: Bootstrap is compatible with all modern browsers (Chrome,
Firefox, Internet Explorer, Edge, Safari, and Opera)
Bootstrap Versions
This tutorial follows Bootstrap 3, which was released in 2013. However, we also cover
newer versions; Bootstrap 4 (released 2018) and Bootstrap 5 (released 2021).
Bootstrap 5 is the newest version of Bootstrap; with new components, faster stylesheets,
more responsiveness etc. It supports the latest, stable releases of all major browsers and
platforms. However, Internet Explorer 11 and down is not supported.
If you do not want to use all 12 columns individually, you can group the columns
together to create wider columns:
span span span span span span span span span 1 span 1 span span
1 1 1 1 1 1 1 1 1 1
span 4 span 8
span 6 span 6
span 12
<div class="row">
<div class="col-*-*"></div>
<div class="col-*-*"></div>
</div>
<div class="row">
<div class="col-*-*"></div>
<div class="col-*-*"></div>
<div class="col-*-*"></div>
</div>
<div class="row">
...
</div>
Bootstrap Basic Table
A basic Bootstrap table has a light padding and only horizontal dividers.
Example
Example
<img src="cinqueterre.jpg" class="img-rounded" alt="Cinque Terre">
Circle
The .img-circle class shapes the image to a circle (IE8 does not support rounded corners):
Example
<img src="cinqueterre.jpg" class="img-circle" alt="Cinque Terre">
Thumbnail
The .img-thumbnail class shapes the image to a thumbnail:
Example
<img src="cinqueterre.jpg" class="img-thumbnail" alt="Cinque Terre">
The .page-header class adds a horizontal line under the heading (+ adds some extra space
around the element):
Example
<div class="page-header">
<h1>Example Page Header</h1>
</div>
Alerts
Bootstrap provides an easy way to create predefined alert messages:
×Warning! This alert box indicates a warning that might need attention.
Alerts are created with the .alert class, followed by one of the four contextual
classes .alert-success, .alert-info, .alert-warning or .alert-danger:
Example
The example below "finds" an HTML element (with id="demo"), and changes the element
content (innerHTML) to "Hello JavaScript":
Example
document.getElementById("demo").innerHTML = "Hello JavaScript";
In this example JavaScript changes the value of the src (source) attribute of an <img> tag:
Example
document.getElementById("demo").style.fontSize = "35px";
JavaScript Where To
The <script> Tag
Example
<script>
document.getElementById("demo").innerHTML = "My First JavaScript";
</script>
A JavaScript function is a block of JavaScript code, that can be executed when "called" for.
For example, a function can be called when an event occurs, like when the user clicks a
button.
Scripts can be placed in the <body>, or in the <head> section of an HTML page, or in both.
JavaScript in <head>
In this example, a JavaScript function is placed in the <head> section of an HTML page.
Example
<!DOCTYPE html>
<html>
<head>
<script>
function myFunction() {
document.getElementById("demo").innerHTML = "Paragraph changed.";
}
</script>
</head>
<body>
</body>
</html>
JavaScript in <body>
In this example, a JavaScript function is placed in the <body> section of an HTML page.
Example
<!DOCTYPE html>
<html>
<body>
<script>
function myFunction() {
document.getElementById("demo").innerHTML = "Paragraph changed.";
}
</script>
</body>
</html>
External JavaScript
Scripts can also be placed in external files:
To use an external script, put the name of the script file in the src (source) attribute of
a <script> tag:
Example
<script src="myScript.js"></script>
Using innerHTML
The id attribute defines the HTML element. The innerHTML property defines the HTML
content:
Example
<!DOCTYPE html>
<html>
<body>
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML = 5 + 6;
</script>
</body>
</html>
Using window.alert()
Example
<!DOCTYPE html>
<html>
<body>
<script>
window.alert(5 + 6);
</script>
</body>
</html>
JavaScript Values
The JavaScript syntax defines two types of values:
Fixed values
Variable values
JavaScript Literals
The two most important syntax rules for fixed values are:
10.50
1001
"John Doe"
'John Doe'
JavaScript Variables
let x;
x = 6;
JavaScript Operators
(5 + 6) * 10
let x, y;
x = 5;
y = 6;
JavaScript Expressions
5 * 10
x * 10
JavaScript Keywords
let x, y;
x = 5 + 6;
y = x * 10;
var x, y;
x = 5 + 6;
y = x * 10;
JavaScript Comments
The rules for legal names are the same in most programming languages.
In this section, you’ll learn how to check which version of Python, if any, is installed on
your Windows computer. You’ll also learn which of the three installation methods you
should use. For a more comprehensive guide, check out Your Python Coding Environment on
Windows:
To check if you already have Python on your Windows machine, first open a command-line application,
such as PowerShell.
Alternatively, you can right-click the Start button and select Windows PowerShell or Windows PowerShell
(Admin).
You can also use cmd.exe or Windows Terminal.
Note: To learn more about your options for the Windows terminal, check out Using the Terminal on
Windows.
With the command line open, type in the following command and press Enter :
C:\> python -V
Python 3.8.4
In either case, if you see a version less than 3.8.4, which was the most recent version at the time of
writing, then you’ll want to upgrade your installation.
Note: If you don’t have a version of Python on your system, then both of the above commands will launch
the Microsoft Store and redirect you to the Python application page. You’ll see how to complete the
installation from the Microsoft Store in the next section.
If you’re interested in where the installation is located, then you can use the where.exe command
in cmd.exe or PowerShell:
As mentioned earlier, there are three ways to install the official Python distribution on Windows:
1. Microsoft Store package: The most straightforward installation method on Windows involves
installing from the Microsoft Store app. This is recommended for beginner Python users looking
for an easy-to-set-up interactive experience.
2. Full Installer: This approach involves downloading Python directly from the Python.org website.
This is recommended for intermediate and advanced developers who need more control during the
setup process.
3. Windows Subsystem for Linux (WSL): The WSL allows you to run a Linux environment
directly in Windows. You can learn how to enable the WSL by reading the Windows Subsystem
for Linux Installation Guide for Windows 10.
In this section, we’ll focus on only the first two options, which are the most popular installation methods
in a Windows environment.
If you want to install in the WSL, then you can read the Linux section of this tutorial after you’ve installed
the Linux distribution of your choice.
Note: You can also complete the installation on Windows using alternative distributions, such
as Anaconda, but this tutorial covers only official distributions.
Anaconda is a popular platform for doing scientific computing and data science with Python. To learn how
to install Anaconda on Windows, check out Setting Up Python for Machine Learning on Windows.
Fibonacci series:
1. a series of numbers in which each number ( Fibonacci number ) is the sum of the
two preceding numbers. The simplest is the series 1, 1, 2, 3, 5, 8, etc.
2. The first two terms are 0 and 1. All other terms are obtained by adding the preceding two terms. This
means to say the nth term is the sum of (n-1)th and (n-2)th term.
Program:
nterms = int(input("How many terms? "))
# first two terms
n1, n2 = 0, 1
count = 0
# check if the number of terms is valid
if nterms <= 0:
print("Please enter a positive integer")
# if there is only one term, return n1
elif nterms == 1:
print("Fibonacci sequence upto",nterms,":")
print(n1)
# generate fibonacci sequence
else:
print("Fibonacci sequence:")
while count < nterms:
print(n1)
nth = n1 + n2
# update values
n1 = n2
n2 = nth
count += 1
Output:
How many terms? 10
Fibonacci sequence:
0 1 1 2 3 5 8 13 21 34
Prime Numbers:
Prime numbers are numbers that have only 2 factors: 1 and themselves. For example, the first 5
prime numbers are 2, 3, 5, 7, and 11.
Program:
# Program to check if a number is prime or not
num = 29
# To take input from the user
#num = int(input("Enter a number: "))
# define a flag variable
flag = False
if num == 1:
print(num, "is not a prime number")
elif num > 1:
# check for factors
for i in range(2, num):
if (num % i) == 0:
# if factor is found, set flag to True
flag = True
# break out of loop
break
# check if flag is True
if flag:
print(num, "is not a prime number")
else:
print(num, "is a prime number")
Output:
29 is a prime number.
Pattern Printing:
Pattern 1
rows = int(input("Enter number of rows: "))
for i in range(rows):
for j in range(i+1):
print("* ", end="")
print("\n")
Output:
Enter number of rows: 3
*
**
***
Pattern 2
rows = int(input("Enter number of rows: "))
for i in range(rows):
for j in range(i+1):
print(j+1, end=" ")
print("\n")
Output:
Enter number of rows: 3
1
12
123
Pattern 3
rows = int(input("Enter number of rows: "))
ascii_value = 65
for i in range(rows):
for j in range(i+1):
alphabet = chr(ascii_value)
print(alphabet, end=" ")
ascii_value += 1
print("\n")
Output:
Enter number of rows: 3
A
BB
CCC
Pattern 4
rows = int(input("Enter number of rows: "))
for i in range(rows, 0, -1):
for j in range(0, i):
print("* ", end=" ")
print("\n")
Output:
Enter number of rows: 3
* * *
* *
*
Pattern 5
rows = int(input("Enter number of rows: "))
for i in range(rows, 0, -1):
for j in range(1, i+1):
print(j, end=" ")
print("\n")
Output:
Enter number of rows: 3
123
12
1
PRACTICLE-7
AIM: Different Python Web framework like: Django and Flask
Django Introduction and Installation
What is Django?
Django is a Python-based web framework which allows you to quickly create web
application without all of the installation or dependency problems that you normally
will find with other frameworks.
When you’re building a website, you always need a similar set of components: a way
to handle user authentication (signing up, signing in, signing out), a management
panel for your website, forms, a way to upload files, etc. Django gives you ready-
made components to use.
Why Django?
Popularity of Django
Django is used in many popular sites like as: Disqus, Instagram, Knight Foundation,
MacArthur Foundation, Mozilla, National Geographic etc. There are more than 5k
online sites based on the Django framework. ( Source )
Sites like Hot Frameworks assess the popularity of a framework by counting the
number of GitHub projects and StackOverflow questions for each platform, here
Django is in 6th position. Web frameworks often refer to themselves as “opinionated”
or “un-opinionated” based on opinions about the right way to handle any particular
task. Django is somewhat opinionated, hence delivers the in both worlds( opinionated
& un-opinionated ).
Features of Django
Versatility of Django
Django can build almost any type of website. It can also work with any client-side
framework and can deliver content in any format such as HTML, JSON, XML etc.
Some sites which can be built using Django are wikis, social networks, new sites etc.
Security
Since Django framework is made for making web development easy, it has been
engineered in such a way that it automatically do the right things to protect the
website. For example, In the Django framework instead of putting a password in
cookies, the hashed password is stored in it so that it can’t be fetched easily by
hackers.
Scalability
Django web nodes have no stored state, they scale horizontally – just fire up more of
them when you need them. Being able to do this is the essence of good scalability.
Instagram and Disqus are two Django based products that have millions of active
users, this is taken as an example of the scalability of Django.
Portability
All the codes of the Django framework are written in Python, which runs on many
platforms. Which leads to run Django too in many platforms such as Linux, Windows
and Mac OS.
Installation of Django
Install
python3 if not installed in your system ( according to configuration of your
system and OS) from here . Try to download the latest version of python it’s
python 3.11.0 this time.
Set Virtual environment- Setting up the virtual environment will allow you to edit
the dependency which generally your system wouldn’t allow.
Follow these steps to set up a virtual environment-
Start the server- Start the server by typing following command in cmd-
python manage.py runserver
To check whether server is running or not go to web browser and
enter http://127.0.0.1:8000/ as url.
Django Urls
from django.urls import path
urlpatterns = [
bands = Band.objects.all()
Templates
Django’s template language is designed to strike a balance between power and ease.
It’s designed to feel comfortable and easy-to-learn to those used to working with
HTML, like designers and front-end developers. But it is also flexible and highly
extensible, allowing developers to augment the template language as needed.
<html>
<head>
<title>Band Listing</title>
</head>
<body>
<h1>All Bands</h1>
<ul>
<li>
</li>
{% endfor %}
</ul>
</body>
</html>
Admin
One of the most powerful parts of Django is its automatic admin interface. It
reads metadata in your models to provide a powerful and production-ready
interface that content producers can immediately use to start managing content
on your site. It’s easy to set up and provides many hooks for customization.
class MemberAdmin(admin.ModelAdmin):
list_filter = ('band',)
What is SQL?
• stands for Structured Query Language
• is a standard language for dealing with Relational Database
• is a query language used for storing, manipulating and retrieving
data stored in relational database
• a non-procedural language (also called a declarative language)
• allows users to query the database in a number of ways, using
English-like statements
• is not case sensitive
Characteristics of SQL
• is easy to learn.
• is used to access data from relational database management
systems.
• can execute queries against the database.
• is used to describe the data.
SQL Environment
Advantages of SQL
What is RDBMS?
MySQL
ORACLE
MS SQL Server
IBM DB2
Microsoft Access
Sybase
PostgreSQL
SQL Lite
DDL:
DCL:
1. CREATE
The CREATE TABLE statement is used to create a new table in a
database.
Syntax:
2. INSERT INTO
The INSERT INTO statement of SQL is used to insert a new row in a
table. There are two ways of using INSERT INTO statement for
inserting rows.
Syntax:
3. SELECT
The SELECT Statement is used to retrieve or fetch data
from the database.
Syntax:
To fetch the entire table or all the fields in the table:
Step 1: Go to the official website of MySQL and download the community server edition
software. Here, you will see the option to choose the Operating System, such as Windows.
Step 2: Next, there are two options available to download the setup. Choose the version
number for the MySQL community server, which you want. If you have good internet
connectivity, then choose the mysql-installer-web-community. Otherwise, choose the other
one.
Step 1: After downloading the setup, unzip it anywhere and double click theMSI
installer .exe file. It will give the following screen:
Step 2: In the next wizard, choose the Setup Type. There are several types available, andyou need
to choose the appropriate option to install MySQL product and features. Here, we are going to
select the Full option and click on the Next button.
This option will install the following things: MySQL Server, MySQL Shell, MySQL
Router, MySQL Workbench, MySQL Connectors, documentation, samples and
examples, and many more.
Step 3: Once we click on the Next button, it may give information about some features that may
fail to install on your system due to a lack of requirements. We can resolve them by clicking on
the Execute button that will install all requirements automatically or
can skip them. Now, click on the Next button.
Step 4: In the next wizard, we will see a dialog box that asks for our confirmation of afew
products not getting installed. Here, we have to click on the Yes button.
After clicking on the Yes button, we will see the list of the products which are going tobe
installed. So, if we need all products, click on the Execute button.
Step 5: Once we click on the Execute button, it will download and install all the products. After
completing the installation, click on the Next button.
Step 6: In the next wizard, we need to configure the MySQL Server and Router. Here, I am not
going to configure the Router because there is no need to use it with MySQL. Weare going to
show you how to configure the server only. Now, click on the Next button.
Step 7: As soon as you will click on the Next button, you can see the screen below. Here,we have
to configure the MySQL Server. Now, choose the Standalone MySQL Server/Classic MySQL
Replication option and click on Next. Here, you can also choose the InnoDB Cluster based on
your needs.
Step 8: In the next screen, the system will ask you to choose the Config Type and other
connectivity options. Here, we are going to select the Config Type as 'Development Machine'
and Connectivity as TCP/IP, and Port Number is 3306, then click on Next.
Step 9: Now, select the Authentication Method and click on Next. Here, I am going toselect
the first option.
Step 10: The next screen will ask you to mention the MySQL Root Password. After fillingthe
password details, click on the Next button.
Step 11: The next screen will ask you to configure the Windows Service to start theserver.
Keep the default setup and click on the Next button.
Step 12: In the next wizard, the system will ask you to apply the Server Configuration. Ifyou
agree with this configuration, click on the Execute button
Step 13: Once the configuration has completed, you will get the screen below. Now,click on
the Finish button to continue.
.
Step 14: In the next screen, you can see that the Product Configuration is completed. Keep
the default setting and click on the Next-> Finish button to complete the MySQLpackage
installation.
Step 15: In the next wizard, we can choose to configure the Router. So click on Next-
>Finish and then click the Next button.
Step 16: In the next wizard, we will see the Connect to Server option. Here, we have to
mention the root password, which we had set in the previous steps.
In this screen, it is also required to check about the connection is successful or not by
clicking on the Check button. If the connection is successful, click on the Execute button.
Now, the configuration is complete, click on Next.
Step 17: In the next wizard, select the applied configurations and click on the Executebutton.
Step 17: In the next wizard, select the Finish button.
Step 19: Now, the MySQL installation is complete. Click on the Finish button.
PRACTICLE -9
WHAT IS TESTING ?
Software testing is the process of evaluating and verifying that a software
product or application does what it is supposed to do. The benefits of testing
include preventing bugs, reducing development costs and improving
performance.
Software testing can be defined as the action for checking if the tangible resultor
output of product matches with the projected or expected output (of your client), and
testing also ensures that the product is free from any bug or defect.
Types of testing:-
1.Manual Testing:-
In manual testing, software testing is done manually without the use of
automated tools or applications available in the market. In this form of testing,
the software tester tests or checks for bugs like the end-user and checks the
project for identifying any abnormal behaviour or bugs in it. Various diverse
phases are there for testing a project manually. These are:
unit-testing
integration testing
system testing and
user acceptance testing
2. Automation Testing:-
Automated testing is the technique of testing a product that requires special
application tools for controlling the test execution and eventually evaluates test
outputs with predicted ones. These tests are automated through these special
tools, and hence the name automated testing requires little or no involvement
from testing engineers or testers. It gives additional testing or supplementary
test, which may be difficult to carry out if done manually.
Test Link
Selenium
IBM Rational Functional Tester
SoapUI
Para soft C/C++test
Ranorex
Test Complete
Test Studio
Testing Anywhere
WinRunner
Web LOAD
LoadRunner
Visual Studio Test Professional
CloudTest
HP Quick Test Professional
Test Case
The test case is defined as a group of conditions under which a tester determines
whether a software application is working as per the customer's requirements or not.
Test case designing includes preconditions, case name, input conditions, and
expected result. A test case is a first level action and derived from test scenarios.
Test case gives detailed information about testing strategy, testing process,
preconditions, and expected output. These are executed during the testing process
to check whether the software application is performing the task for that it was
developed or not.
When do we write a test case?
We will write the test case when we get the following:
o When the customer gives the business needs then, the developer starts developing
and says that they need 3.5 months to build this product.
o And In the meantime, the testing team will start writing the test cases.
o Once it is done, it will send it to the Test Lead for the review process.
o And when the developers finish developing the product, it is handed over to the
testing team.
o The test engineers never look at the requirement while testing the product
document because testing is constant and does not depends on the mood of the
person rather than the quality of the test engineer.
To require consistency in the test case execution: we will see the test case and
start testing the application.
To make sure a better test coverage: for this, we should cover all possible
scenarios and document it, so that we need not remember all the scenarios again
and again.
It depends on the process rather than on a person: A test engineer has tested an
application during the first release, second release, and left the company at the time
of third release. As the test engineer understood a module and tested the application
thoroughly by deriving many values.
To avoid giving training for every new test engineer on the product: When the
test engineer leaves, he/she leaves with a lot of knowledge and scenarios. Those
scenarios should be documented so that the new test engineer can test with the
given scenarios and also can write the new scenarios.
Test case template
The primary purpose of writing a test case is to achieve the efficiency of the
application.
As we know, the actual result is written after the test case execution, and most of
the time, it would be same as the expected result. But if the test step will fail, it will
be different. So, the actual result field can be skipped, and in the Comments section,
we can write about the bugs.
And also, the Input field can be removed, and this information can be added to
the Description field.
The test case should be written in simple language so that a new test engineer can
also understand and execute the same.
Step number
It is also essential because if step number 20 is failing, we can document the bug
report and hence prioritize working and also decide if it’s a critical bug.
Release
Pre-condition
These are the necessary conditions that need to be satisfied by every test engineer
before starting the test execution process. Or it is the data configuration or the data
setup that needs to be created for the testing.
For example: In an application, we are writing test cases to add users, edit users,
and delete users. The per-condition will be seen if user A is added before editing it
and removing it.
Test data
These are the values or the input we need to create as per the per-condition.
The test lead may be given the test data like username or password to test the
application, or the test engineer may themself generate the username and password.
Severity
The severity can be major, minor, and critical, the severity in the test case talks
about the importance of that particular test cases. All the text execution process
always depends on the severity of the test cases.
We can choose the severity based on the module. There are many features include
in a module, even if one element is critical, we claim that test case to be critical. It
depends on the functions for which we are writing the test case.
For example, we will take the Gmail application and let us see the severity based on
the modules:
Modules Severity
Login Critical
Help Minor
Setting Minor
Inbox Critical
Logout Critical
Modules Severity
Feedback minor
Brief description
The test engineer has written a test case for a particular feature. If he/she comes and
reads the test cases for the moment, he/she will not know for what feature has
written it. So, the brief description will help them in which feature test case is written.
The functional test case for amount transfer module is in the below Excel file:
When the test engineer writing the test cases, they may need to consider the
following aspects:
In this, we will understand the application by looking at the requirements or the SRS,
which is given by the customer.
o When the product is launched, what are the possible ways the end-user may use the
software to identify all the possible ways.
o I have documented all possible scenarios in a document, which is called test
design/high-level design.
Convert all the identified scenarios to test claims and group the scenarios related to
their features, prioritize the module, and write test cases by applying test case design
techniques and use the standard test case template, which means that the one which
is decided for the project.
Review the test case by giving it to the head of the team and, after that, fix the review
feedback given by the reviewer.
After fixing the test case based on the feedback, send it again for the approval.
After the approval of the particular test case, store in the familiar place that is known
as the test case repository.
Practical- 10
What is Git?
Git is a version control system for tracking changes in computer files. It helps in coordinating work
amongst several people in a project and tracks progress over time. Unlike the centralized version control
system, Git branches can be easily merged. A new branch is created every time a developer wants to start
working on something. This ensures that the master branch always has a production-quality code.
Git is a distributed version control system, so here, every developer gets their local repository with full
commit history. The commit history makes Git fast, as now a network connection is not needed to create
commits or perform diffs between commits.
What is GitHub?
GitHub is a Git repository hosting service that provides a web-based graphical interface (GUI). It helps
every team member work together on a project from anywhere, making it easy to collaborate.
GitHub is one place where project managers and developers coordinate, track, and update their work, so
projects stay transparent and on schedule. The packages can be published privately, within the team, or
publicly for the open-source community. Downloading packages from GitHub enables them to be used
and reused. GitHub helps all team members stay on the same page and stay organized. Moderation tools,
like issue and pull request locking, helps the team focus on the code.
The Git push command is used to push the local repository content to a remote repository. After a local repository
has been modified, a push is executed to share the modifications with remote team members. Pushing is the way
commits are transferred from the local repository to the remote repository.
Next, let's check the status of the file that was created using git status
This shows that there isn't a file committed yet, and there are untracked files. The untracked files can be seen in red.
For Git to track that file, add command is used. If you know the exact name of the file, you can specify it and simply
type the following command:
This displays the commit ID, author's name, and email ID used. You can also find the date and commit message on
the screen.
A merge conflict is an event that takes place when Git is unable to automatically resolve differences in code between
two commits. Git can merge the changes automatically only if the commits are on different lines or branches.
Let’s assume there are two developers: Developer A and Developer B. Both of them pull the same code
file from the remote repository and try to make various amendments in that file. After making the changes,
Developer A pushes the file back to the remote repository from his local repository. Now, when Developer
B tries to push that file after making the changes from his end, he is unable to do so, as the file has already
been changed in the remote repository.
To prevent such conflicts, developers work in separate isolated branches. The Git merge command
combines separate branches and resolves any conflicting edits.