VISVESVARAYA TECHNOLOGICAL UNIVERSITY “Jnana Sangama”, Belagavi – 590 018

A PROJECT REPORT ON “Environment Setup for various Programming Languages” Submitted in partial fulfillment for the award of the degree of BACHELOR OF ENGINEERING IN COMPUTER SCIENCE AND ENGINEERING BY RAHUL.S (1NH12CS741) ANURAG (1NH12CS708)

Under the guidance of Ms. T.KARTHIKAYINI (Assistant Professor, Dept. of CSE, NHCE)

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING NEW HORIZON COLLEGE OF ENGINEERING (ISO-9001:2000 certified, Accredited by NAAC ‘A’ , Permanently affiliated to VTU) Outer Ring Road,Panathur Post, Near Marathalli, Bangalore – 560103 NEW HORIZON COLLEGE OF ENGINEERING (ISO-9001:2000 certified, Accredited by NAAC ‘A’ Permanently affiliated to VTU) Outer Ring Road, Panathur Post, Near Marathalli, Bangalore-560 103 DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

CERTIFICATE

Certified that the project work entitled “ENVIRONMENT SETUP FOR VARIOUS PROGRAMMING LANGAUGES” carried out by RAHUL.S (1NH12CS741) & ANURAG (1NH12CS708) bonafide students of NEW HORIZON COLLEGE OF ENGINEERING in partial fulfillment for the award of Bachelor Of Engineering/Bachelor Of Technology in Computer Science and Engineering of the Visvesvaraya Technological University, Belgaum during the year 2015-2016. It is certified that all corrections/suggestions indicated for Internal Assessment have been incorporated in the report deposited in the department . The project report has been approved as it satisfies the academic requirements in respect of Project work prescribed for the said Degree.

Name & Signature of Guide Name & Signature of HOD Signature of Principal (Ms.T.Karthikayini ) (Dr. Prashanth .S..) (Dr. Manjunatha)

External Viva Name of Examiner Signature with date 1. 2.

ACKNOWLEDGEMENT

The satisfaction and euphoria that accompany the successful completion of any task would be, but impossible without the mention of the people who made it possible, whose constant guidance and encouragement crowned our efforts with success.

We thank the management, Dr. Mohan Manghnani, Chairman of NEW HORIZON EDUCTIONAL INSTITUTIONS for providing necessary infrastructure and creating good environment.

We also record here the constant encouragement and facilities extended to us by Dr. Manjunatha, Principal, NHCE and Dr. Prashanth.C.S.R, Dean Academics, Head of the Department of Computer Science and Engineering. We extend our sincere gratitude to them.

We express our gratitude to Ms T.Karthikayini, our project guide for constantly monitoring the development of the project and setting up precise deadlines. Their valuable suggestions were the motivating factors in completing the work.

We would also like to express our gratitude to NHCE and to all our external guides at NHCE for their continuous guidance and motivation.

Finally a note of thanks to the teaching and non-teaching staff of Computer Science and Engineering Department for their cooperation extended to us and our friends, who helped us directly or indirectly in the course of the project work.

RAHUL.S (1NH12CS741) ANURAG (1NH12CS708)

I

ABSTRACT

In this project ,we are designing a shell script which can be executed on Unix like OS platform such as Ubuntu ,Fedora etc with the aim of helping a novice user to setup and configure the environment and IDE and to repair any existing ones if necessary. We have designed a simple menu driven program which will help the user to go through this setup easily and without any hassle. At each step the program will ask the user to select the particular option listed and display and confirmatory message asking if he wishes to proceed further or abort the menu. This script will ask the user to pick his and then it will check whether the environment for the picked language is setup properly or not. If the environment is not setup then it will automatically download the appropriate packages and it's dependencies from internet and install it and set different environment variables. This project is purely based on scripting and commands of Unix like OS.Most of the new or even experienced of ,C, C++,etc don't have deep knowledge of these OS , so they find it hard to setup the appropriate environment for the programming language they prefer to code in.As a result they spend extra time to achieve this.All the programmers new or experienced can use this script and save their time.

II

CONTENTS

1. INTRODUCTION 1.1. ENVIRONMENT SETUP 1 1.2. PROBLEM DEFINITION 2 1.3. PROJECT PURPOSE 2 1.4. PROJECT FEATURES 2 1.5. MODULES DESCRIPTION 3

2. LITERATURE SURVEY 2.1. FEDORA 4 2.2. C++ 5 2.3. QT TOOLKIT 6 2.4. UBUNTU 7 2.5. JAVA 8 2.6. PYTHON 9 2.7. C 10 2.8. ANDROID 11 2.9. IDE 12 2.10. IDE 13

3. REQUIREMENT ANALYSIS 3.1. FUNCTIONAL REQUIREMENTS 14 3.2. NON FUNCTIONAL REQUIREMENTS 14 3.3. HARDWARE REQUIREMENTS 16 3.4. REQUIREMENTS 16

4. DESIGN 4.1. DESIGN GOALS 17 4.2. SYSTEM ARCHITECTURE 17 4.3. SYSTEM DEVELOPMENT METHODOLOGY 19

III

4.4. FLOW DIAGRAM 21

5. IMPLEMENTATION 5.1. SELECTION OF PLATFORM (OS) 22 5.2. FUNCTIONS USED 23 5.3. COMMANDS USED 31

6. TESTING 6.1 UNIT TESTING 33 6.2 INTEGRATION TESTING 33 6.3 VALIDATION TESTING 34 6.4 SYSTEM TESTING 35 6.5 TESTING OF SHELL SCRIPT 36

7. SNAPSHOTS 41

8. CONCLUSION AND FUTURE ENHANCEMENT 8.1 CONCLUSION 45 8.2 FUTURE ENHANCEMENT 45

BIBLIOGRAPHY 46

IV

LIST OF FIGURES

4.1 Unix System Architecture 18 4.2 Waterfall Model 20 4.4 Flow Diagram 21 6.1 Testing Process 34

LIST OF TABLES

6.1Test case for Menu Selection 36 6.2Test case for working of compiler 37 6.3Test case for environment configuration 38 6.4 Test case for IDE setup 39 6.5Test case for repair environment 40

V

Environment Setup for PL

CHAPTER 1

INTRODUCTION

1.1 ENVIRONMENT SETUP

In computers, the term environment when unqualified usually refers to the combination of hardware and software in a computer . In this usage, the term platform is a synonym. We often tend to think of environment as short for environment , but, with the exception of UNIX -based operating systems, the operating system usually implies an underlying hardware microprocessor that the operating system is designed to run on.

Environment variables are a set of dynamic named values that can affect the way running processes will behave on a computer. They are part of the environment in which a process runs. For example, a running process can query the value of the TEMP environment variable to discover a suitable location to store temporary files, or the HOME or USERPROFILE variable to find the directory structure owned by the user running the process.

They were introduced in their modern form in 1979 with Version 7 Unix, so are included in all Unix operating system flavors and variants from that point onward including and OS X. From PC DOS 2.0 in 1982, all succeeding Microsoft operating systems including also have included them as a feature, although with somewhat different syntax, usage and standard variable names.

Examples of environment variables include:

 Path– a list of directory paths. When the user types a command without providing the full path, this list is checked to see whether it contains a path that leads to the command.

 Home (Unix-like) and USERPROFILE (Microsoft Windows) – indicate where a user's home directory is located in the file system.

 Temp – location where processes can store temporary files.

Dept of CSE, NHCE 1

Environment Setup for PL

1.2 PROBLEM DEFINITION

This script program will ask to pick his programming language & then it will check whether the environment and its dependencies for the picked language is properly set up or not, if not set up then it will download the appropriate packages and its dependencies from internet and install it and set the different environment variables.

1.3 PROJECT PURPOSE The main objective of this project is to reduce the burden from the programmers both beginners and novice to set the programming environment for coding because he or she may not be knowing the methods and procedures to do so. This shell script can also be implemented in our college labs to keep a tab on the possible corruption of environment due to various reasons & check on the Integrated Development Environments (IDE) of various programming languages such as ECLIPSE for JAVA.

1.4 PROJECT FEATURES

 Our scheme was developed to reduce the computational overhead of the experienced programmer as well as to minimize the computational overhead of the rookie user.  It uses one of the simplest forms of coding which is programming in shell script.  Easier to learn and for beginners who are new to OS such as Ubuntu and Fedora.  It is a simple and menu driven program.  Has been designed in two different OS ie Fedora and Ubuntu.  Has been implemented for programming langauges such as Java, Python,C,C++ .

Dept of CSE, NHCE 2

Environment Setup for PL

1.5 MODULES DESCRIPTION

1.5.1 Setup and Configuration of the environment

In this first and main module we have to setup the environment for the selected Programming Langauge under a particular UNIX like OS.

In our program we will be setting up and configuring environments for the following programming langauges

1.JAVA

2.C Langauge

3.C++

4.PYTHON

5.ANDROID.

1.5.2 Setup of Integrated Development Environment(IDE)

This phase covers the downloading and installation of various IDE’s for various programming langauges.

For example ,the user will be asked whether he wants to download and install Eclipse which Is the Integrated Development Environment for Java..

1.5.3 Repair the environment & IDE

In this module ,should there be any errors in the environment setup or in the installation of Integrated Development Environment ,we can detect these errors and repair them using the script.

Dept of CSE, NHCE 3

Environment Setup for PL

CHAPTER 2 LITERATURE SURVEY

2.1 FEDORA

Fedora (formerly Fedora Core) is an operating system based on the Linux kernel, developed by the community-supported Fedora Project and sponsored by Red Hat. Fedora contains software distributed under a free and open source license and aims to be on the leading edge of such technologies.

Fedora has a reputation for focusing on innovation, integrating new technologies early on and working closely with upstream Linux communities. Making changes upstream instead of specifically in Fedora ensures that the changes are available to all Linux distributions.

Fedora has a relatively short life cycle: version X is supported only until 1 month after version X+2 and with approximately 6 months between versions, this means that a version of Fedora is supported for approximately 13 months. This promotes leading-edge software because it frees developers from some backward compatibility restraints, but it also makes Fedora a poor choice for product development, which usually requires long- term vendor-support. Fedora users can upgrade from version to version using FedUp.

The default desktop in Fedora is the GNOMEdesktop environment and the default interface is the GNOME Shell. Other desktop environments, including KDE, Xfce, LXDE, MATE and Cinnamon, are available and can be installed. Fedora uses the RPM package management system.

Security is also important in Fedora with one specific security feature being Security- Enhanced Linux, which implements a variety of security policies, including mandatory access controls, and which Fedora adopted early on.

Dept of CSE, NHCE 4

Environment Setup for PL

2.2 C++

C++ (pronounced as cee plus plus, is a general-purpose programming language. It has imperative, object-oriented and generic programming features, while also providing the facilities for low-level memory manipulation.

It is designed with a bias toward system programming (e.g., for use in embedded systems or operating system kernels), with performance, efficiency and flexibility of use as its design requirements. C++ has also been found useful in many other contexts, including desktop applications, servers (e.g. e-commerce, web search or SQL servers), performance-critical applications (e.g. telephone switches or space probes), and entertainment software. C++ is a compiled language, with implementations of it available on many platforms and provided by various organizations, including the FSF, LLVM, Microsoft and Intel.

C++ is standardized by the International Organization for Standardization (ISO), with the latest standard version ratified and published by ISO in December 2014 asISO/IEC 14882:2014 (informally known as C++14).[6] The C++ programming language was initially standardized in 1998 as ISO/IEC 14882:1998, which was then amended by the C++03, ISO/IEC 14882:2003, standard. The current C++14 standard supersedes these and C++11, with new features and an enlarged standard library. Before the initial standardization in 1998, C++ was developed by Bjarne Stroustrup at Bell Labs since 1979, as an extension of the C language as he wanted an efficient and flexible language similar to C, which also provided high-level features for program organization.

Dept of CSE, NHCE 5

Environment Setup for PL

2.3 QT TOOLKIT

Qt is used mainly for developing application software with graphical user interfaces (GUIs); however, programs without a GUI can be developed, such as command-line tools and consoles for servers. An example of a non-GUI program using Qt is the Cutelyst web framework. GUI programs created with Qt can have a native-looking interface, in which cases Qt is classified as a widget toolkit.

Qt uses standard C++ with extensions including signals and slots that simplifies handling of events, and this helps in development of both GUI and server applications which receive their own set of event information and should process them accordingly. Qt supports many compilers, including the GCC C++ compiler and the Visual Studio suite. Qt also provides Qt Quick, that includes a declarative called QML that allows using JavaScript to provide the logic. With Qt Quick, rapid application development for mobile devices became possible, although logic can be written with native code as well to achieve the best possible performance. Qt can be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include SQL database access, XML parsing, JSON parsing, thread management and network support.

2.3.1 Supported platforms

Android, Embedded Linux, Integrity, iOS, OS X, QNX / BlackBerry 10, VxWorks,

Wayland, Windows, Windows CE, Windows RT, X11.

Dept of CSE, NHCE 6

Environment Setup for PL

2.4 UBUNTU

Ubuntu is a Debian based Linux Operating System and distribution for personal computers, smartphones and network servers. It usesUnity as its default user interface. It is based on and named after the Southern African philosophy of ubuntu (literally, "human-ness"), which often is translated as "humanity towards others" or "the belief in a universal bond of sharing that connects all humanity".

Development of Ubuntu is led by UK-based Canonical Ltd., a company owned by South African entrepreneur Mark Shuttleworth. Canonical generates revenue through the sale of technical support and other services related to Ubuntu. The Ubuntu project is publicly committed to the principles of open-source ; people are encouraged to use free software, study how it works, improve upon it, and distribute it.

In March 2016 Microsoft announced that they would support the Ubuntu userland on top of the Windows 10 kernel by implementing the Linux system calls as a subsystem.

A default installation of Ubuntu contains a wide range of software that includes LibreOffice, Firefox, Thunderbird, Transmission, and several lightweight games such as Sudoku and chess. Many additional software packages, including titles no longer in the default installation such as Evolution, GIMP, Pidgin, and Synaptic, are accessible from the built in Ubuntu Software Center as well as any other APT-based package management tool.

Ubuntu operates under the GNU General Public License (GPL) and all of the application software installed by default is free software. In addition, Ubuntu installs some hardware drivers that are available only in binary format, but such packages are clearly marked in the restricted component.

Dept of CSE, NHCE 7

Environment Setup for PL

2.5 JAVA

Java is a set of computer software and specifications developed by Sun Microsystems, which was later acquired by the Oracle Corporation, that provides a system for developing application software and deploying it in a cross-platform computing environment. Java is used in a wide variety of computing platforms from embedded devices and mobile phones to enterprise servers and supercomputers. While they are less common than standalone Java applications, Java applets run in secure,sandboxed environments to provide many features of native applications and can be embedded in HTML pages.

Writing in the Java programming language is the primary way to produce code that will be deployed as byte code in a (JVM); byte code compilersare also available for other languages, including Ada, JavaScript, Python, and Ruby. In addition, several languages have been designed to run natively on the JVM, including Scala, Clojure and Groovy. Java syntax borrows heavily from C and C++, but object-oriented features are modeled after and Objective-C. Java eschews certain low-level constructs such as pointers and has a very simple memory model where every object is allocated on the heap and all variables of object types are references. Memory management is handled through integrated automatic garbage collection performed by the JVM.

On November 13, 2006, Sun Microsystems made the bulk of its implementation of Java available under the GNU General Public License (GPL).

The latest version is Java 8, the only supported version as of 2015.

Dept of CSE, NHCE 8

Environment Setup for PL

2.6 PYTHON

Python is a widely used high-level, general-purpose, interpreted, dynamic programming language. Its design philosophy emphasizes code readability, and its syntax allows programmers to express concepts in fewer lines of code than would be possible in languages such as C++ or Java. The language provides constructs intended to enable clear programs on both a small and large scale.

Python supports multiple programming paradigms, including object- oriented, imperative and functional programming or procedural styles. It features a dynamic typesystem and automatic memory management and has a large and comprehensive standard library.

Python interpreters are available for many operating systems, allowing Python code to run on a wide variety of systems. Using third-party tools, such as Py2exe or Pyinstaller, Python code can be packaged into stand-alone executable programs for some of the most popular operating systems, so Python-based software can be distributed to, and used on, those environments with no need to install a Python interpreter.

CPython, the reference implementation of Python, is free and open-source software and has a community-based development model, as do nearly all of its variant implementations. CPython is managed by the non-profit Python Software Foundation.

Python's development is conducted largely through the Python Enhancement Proposal (PEP) process. The PEP process is the primary mechanism for proposing major new features, for collecting community input on an issue, and for documenting the design decisions that have gone into Python. Outstanding PEPs are reviewed and commented upon by the Python community and by Van Rossum, the Python project'sbenevolent dictator for life.

Dept of CSE, NHCE 9

Environment Setup for PL

2.7 C Langauge

C (/ˈsiː/, as in the letter c) is a general-purpose, imperative computer programming language, supporting structured programming, lexical variable scope and recursion, while a static type system prevents many unintended operations. By design, C provides constructs that map efficiently to typical machine instructions, and therefore it has found lasting use in applications that had formerly been coded in assembly language, including operating systems, as well as various application software for computers ranging from supercomputers to embedded systems.

C was originally developed by Dennis Ritchie between 1969 and 1973 at Bell Labs, and used to re-implement the Unix operating system. It has since become one of the most widely used programming languages of all time, with C compilers from various vendors available for the majority of existing computer architectures and operating systems. C has been standardized by the American National Standards Institute (ANSI) since 1989 (see ANSI C) and subsequently by the International Organization for Standardization (ISO).

C is an imperative (procedural) language. It was designed to be compiled using a relatively straightforward compiler, to provide low-level access to memory, to provide language constructs that map efficiently to machine instructions, and to require minimal run-time support. C was therefore useful for many applications that had formerly been coded in assembly language, such as in system programming.

Despite its low-level capabilities, the language was designed to encourage cross- platform programming. A standards-compliant and portably written C program can be compiled for a very wide variety of computer platforms and operating systems with few changes to its . The language has become available on a very wide range of platforms, from embedded microcontrollers to supercomputers.

Dept of CSE, NHCE 10

Environment Setup for PL

2.8 ANDROID

Android is a mobile operating system (OS) currently developed by Google, based on the Linux kernel and designed primarily for touchscreen mobile devices such as smartphones and tablets. Android's user interface is mainly based on direct manipulation, using touch gestures that loosely correspond to real-world actions, such as swiping, tapping and pinching, to manipulate on-screen objects, along with a virtual keyboard for text input. In addition to touchscreen devices, Google has further developed Android TV for televisions, Android Auto for cars, and Android Wear for wrist watches, each with a specialized user interface. Variants of Android are also used on notebooks, game consoles, digital cameras, and other electronics.

Android has the largest installed base of all operating systems of any kind. Android has been the best selling OS on tablets since 2013, and on smartphones it is dominant by any metric.

Initially developed by Android, Inc., which Google bought in 2005, Android was unveiled in 2007, along with the founding of the Open Handset Alliance – a consortium of hardware, software, and telecommunication companies devoted to advancing open standards for mobile devices. As of July 2013, the Google Play store has had over one million Android applications ("apps") published, and over 50 billion applications downloaded. An April–May 2013 survey of mobile application developers found that 71% of developers create applications for Android, and a 2015 survey found that 40% of full-time professional developers see Android as their priority target platform, which is comparable to Apple's iOS on 37% with both platforms far above others. At Google I/O 2014, the company revealed that there were over one billion active monthly Android users, up from 538 million in June 2013.

Android's source code is released by Google under open source licenses, although most Android devices ultimately ship with a combination of open source and , including proprietary software required for accessing Google services. Android is popular with technology companies that require a ready-made, low-cost and customizable operating system for high-tech devices.

Dept of CSE, NHCE 11

Environment Setup for PL

2.9 ECLIPSE IDE

Eclipse is an integrated development environment (IDE) used in computer programming. It contains a base workspace and an extensible plug-in system for customizing the environment. Eclipse is written mostly in Java and its primary use is for developing Java applications, but it may also be used to develop applications in other programming languages through the use of plugins including: Ada, ABAP, C, C++, COBOL, , Haskell, JavaScript, Julia, Lasso, Lua,NATURAL, , PHP, Pro log, Python, R, Ruby (including Ruby on Rails framework), Rust, Scala, Clojure, Groovy, Scheme, and Erlang. It can also be used to develop packages for the software Mathematica. Development environments include the Eclipse Java development tools (JDT) for Java and Scala, Eclipse CDT forC/C++ and Eclipse PDT for PHP, among others.

The initial codebase originated from IBM VisualAge. The Eclipse software development kit (SDK), which includes the Java development tools, is meant for Java developers. Users can extend its abilities by installing plug-ins written for the Eclipse Platform, such as development toolkits for other programming languages, and can write and contribute their own plug-in modules.

Released under the terms of the Eclipse Public License, Eclipse SDK is free and open- source software (although it is incompatible with the GNU General Public License). It was one of the first IDEs to run under GNU Classpath and it runs without problems under IcedTea.

The Eclipse SDK includes the Eclipse Java development tools (JDT), offering an IDE with a built-in incremental Java compiler and a full model of the Java source files. This allows for advanced refactoring techniques and code analysis. The IDE also makes use of a workspace, in this case a set of metadata over a flat filespace allowing external file modifications as long as the corresponding workspace "resource" is refreshed afterwards.

Dept of CSE, NHCE 12

Environment Setup for PL

2.10 GEANY IDE

Geany (IPA:ʒeːniː) is a lightweight GUI using Scintilla and GTK+, including basic IDE features. It is designed to have short load times, with limited dependency on separate packages or external libraries on Linux. It has been ported to a wide range of operating systems, such as BSD, Linux, Mac OS X, Solaris and Windows. Among the supported programminglanguages and markuplanguages are C, C++, C#, Java, JavaScript PHP, HTML, LaTeX, CSS, Python,Perl, Ruby, Pascal, Haskell, Erlang, Vala and many others.

In contrast to traditional Unix-based editors like or , Geany more closely resembles programming editors available for Microsoft Windows such asProgrammer's Notepad or Notepad++, both of which also use Scintilla.

It is free software licensed under the terms of the GNU GPL version 2 or later. After version 0.21 the next version was numbered 1.22 as requested by many users to reflect the maturity of the product.

Features

 Auto-completion

 Multiple document support

 Project support

(partially)

 Symbol lists

 Code navigation Embedded terminal emulator[6]

 Build system to compile and execute code using external tools

 Extensible via plugins

 Column / block / vertical select

Dept of CSE, NHCE 13

Environment Setup for PL

CHAPTER 3 REQUIREMENT ANALYSIS

3.1 FUNCTIONAL REQUIREMENTS

In software engineering, a functional requirement defines a function of a software system or its component. A function is described as a set of inputs, the behavior, and outputs. Functional requirements may be calculations, technical details, data manipulation and processing and other specific functionality that define what a system is supposed to accomplish. Behavioral requirements describing all the cases where the system uses the functional requirements are captured in use cases.

Here, the system has to perform the following tasks:

 Take userid and password along with secret key, match it with corresponding database entries. If a match is found then continue else raise an error message.  Encrypt the file to form a new encrypted file by using an encryption algorithm.  Must be able to retrieve the original file from the encrypted file using the corresponding decryption algorithm.  If any modification is performed on encrypted file, owner of the file should be notified.

3.2 NON-FUNCTIONAL REQUIREMENTS

In systems engineering and requirements engineering, a non-functional requirement is a requirement that specifies criteria that can be used to judge the operation of a system, rather than specific behaviors. This should be contrasted with functional requirements that define specific behavior or functions. The plan for implementing functional requirements is detailed in the system design. The plan for implementing non-functional requirements is detailed in the system architecture.

Other terms for non-functional requirements are "constraints", "quality attributes", "quality goals", "quality of service requirements" and "non-behavioral requirements".

Dept of CSE, NHCE 14

Environment Setup for PL

3.2.1 ACCESSIBILITY:

Accessibility is a general term used to describe the degree to which a product, device, service, or environment is accessible by as many people as possible.

In our project people who have superuser access or root permission can be able to run the shell script.

3.2.2 MAINTAINABILITY:

In software engineering, maintainability is the ease with which a software product can be modified in order to:

 Correct defects

 Meet new requirements

New functionalities can be added in the project based on the user requirements just by tweaking the programming code according to the requirements of the user. Since the programming is very simple, it is easier to find and correct the defects and to make the changes in the project.

3.2.3 SCALABILITY:

System is capable of handling increase total throughput under an increased load when resources (typically hardware) are added. System can work normally under situations such as low memory and large number of users.

3.2.4 PORTABILITY:

Portability is one of the key concepts of high-level programming. Portability is the software code base feature to be able to reuse the existing code instead of creating new code when moving software from an environment to another.

Our Project can be executed under different operation conditions provided it meet its minimum configurations.

Dept of CSE, NHCE 15

Environment Setup for PL

3.3 HARDWARE REQUIREMENTS

Processor : Any Processor above 500 MHz RAM : 512Mb Hard Disk : 2 GB Input device : Standard Keyboard and Mouse Output device : VGA and High Resolution Monitor Internet Connection :Wired or Wireless

3.4 SOFTWARE REQUIREMENTS

• Operating system : Ubuntu/Fedora • Server : Internet Information Services

• Editor : Gedit Text Editor. • Utility :SH Utility , unzip utility. • Acess :Super ( Root ) permission/access

Dept of CSE, NHCE 16

Environment Setup for PL

CHAPTER 4 DESIGN

4.1 DESIGN GOALS

To enable a smooth menu based step by step procedure to download and install the environment and its dependencies

4.1.2 EFFICIENCY The local computations done by customer should be substantially less than. The resources used by the system should be less and the result should be obtained with minimum time complexity.

4.2 SYSTEM ARCHITECTURE

A Unix architecture is a computer operating system architecture that embodies the Unix philosophy. It may adhere to standards such as the Single UNIX Specification(SUS) or similar POSIX IEEE standard. No single published standard describes all Unix architecture computer operating systems - this is in part a legacy of the Unix wars.

A Unix kernel — the core or key components of the operating system — consists of many kernel subsystems like process management, scheduling, file management, device management and network management, memory management, dealing with interrupts from hardware devices.

Computer hardware is the physical parts or components of a computer, such as the monitor, mouse, keyboard, computer data storage, hard disk drive (HDD), graphic cards, sound cards, memory (RAM), motherboard, and so on, all of which are tangible physical objects.

An application program (sometimes shortened to application) is any program designed to perform a specific function directly for the user or, in some cases, for another application program. Examples of application programs include word processors; database programs;

Dept of CSE, NHCE 17

Environment Setup for PL

Fig 4.1 Unix System Architecture

Dept of CSE, NHCE 18

Environment Setup for PL

4.3 SYSTEM DEVELOPMENT METHODOLOGY

SDLC or Software development life cycle is a model of detailed plan on how to create, develop, implement and eventually fold the software. Waterfall approach was first SDLC Model to be used widely in Software Engineering to ensure success of the project. In "The Waterfall" approach, the whole process of software development is divided into separate phases. In Waterfall model, typically, the outcome of one phase acts as the input for the next phase sequentially.

The sequential phases in Waterfall model are:  Requirement Gathering and analysis All possible requirements of the system to be developed are captured in this phase and documented in a requirement

specification doc.  System Design: The requirement specifications from first phase are studied in this phase and system design is prepared. System Design helps in specifying hardware

and system requirements and also helps in defining overall system architecture.  Implementation: With inputs from system design, the system is first developed in small programs called units, which are integrated in the next phase. Each unit is

developed and tested for its functionality which is referred to as Unit Testing.  Integration and Testing: All the units developed in the implementation phase are integrated into a system after testing of each unit. Post integration the entire

system is tested for any faults and failures.  Deployment of system: Once the functional and non functional testing is done,

the product is deployed in the customer environment or released into the market.  Maintenance: There are some issues which come up in the client environment. To fix those issues patches are released. Also to enhance the product some better versions are released. Maintenance is done to deliver these changes in the

customer environment. All these phases are cascaded to each other in which progress is seen as flowing

steadily downwards (like a waterfall) through the phases.

Dept of CSE, NHCE 19

Environment Setup for PL

Following is a diagrammatic representation of different phases of waterfall model.

Fig 4.2 WATERFALL MODEL

Dept of CSE, NHCE 20

Environment Setup for PL

4.4 FLOW DIAGRAM

Envsetup.sh

configure Repair Setup IDE environment environment nt

Config Config Config Repairenv() java() C++() python()

Setup Setup QT() Setup Eclipse() Geany()

Fig 4.3 Flow Diagram.

Dept of CSE, NHCE 21

Environment Setup for PL

CHAPTER 5 IMPLEMENTATION

The Implementation is the carrying out, execution,or practice of a plan, a method ,or any design for doing something. As such, implementation is the action that must follow any preliminary thinking in order for something to actually happen. Implementation encompasses all processes involved in getting new software operating properly in its environment, including running,configuration,testing and making necessary changes.

There are 2 major implementation decisions that have been made before the implementation of this project.

o Selection of Platform (O.S).

o Selection of programming language to be used.

5.1 Selection of Platform (OS)

Since the software is being developed in Ubuntu and Fedora it’s a cross platform software.

It can be implemented in different flavors of Unix.

5.1.1 Selection of Programming Language

Shell Scripting is the language used.

5.1.2 Steps to be followed

Install Ubuntu and Fedora.

Have sh utility installed.

Have access to the root directory.

Run the shell script and follow the instructions.

Dept of CSE, NHCE 22

Environment Setup for PL

5.2 THE FUNCTIONS USED ARE AS FOLLOWS

1) showOSMenu()- function to show OS selection menu on startup. 2) showUtilitiesMenu()- Function to show the menu for the available utilities in this script. 3) selectAndConfigEnvMenu()-Function to show menu for setting up environment for different PL. 4) testJavaCompiler()-Function to write hello world program in .java file and test and exetute. 5) testCPPCompiler()- Function to write hello world program in .cpp file and test and exetute. 6) testPythonCompiler()-Function to write hello world program in .py file and test and exetute. 7) configJavaEnv()- Function to configure the java environment. 8) configCPPEnv()- Function to configure C or C++ Environment. 9) configPythonEnv()- Function to configure Python Environment. 10) setupIDEMenu()- Function to show menu for setting up IDE for different PLs. 11) setupAndroidStudio()- Function to download and install . 12) setupEclipse()- Function to download and install Eclipse. 13) setupQt()- Function to download and install Qt. 14) setupGeany()- Function to download and install Geany. 15) repairEnv()- Function to repair the environment.

Dept of CSE, NHCE 23

Environment Setup for PL

5.2.1 showOSMenu() showOSMenu() { clear; majentaEcho "\n\n\t\tSCRIPT TO SETUP ENVIRONMENT VARIABLES"; majentaEcho "\t------" blueEcho "\n\n\t1. Ubuntu"; blueEcho "\t2. Fedora (Will work on Redhat,Cent OS,Open Suse)"; blueEcho "\n\t\tSelect the host OS type";

tput cuf 12; read OS_CHOICE; }

5.2.2 showUtilitiesMenu() showUtilitiesMenu() { clear; majentaEcho "\n\n\t\tSCRIPT UTILITIES FOR ENVIR0NMENT SETUP"; majentaEcho "\t------" blueEcho "\n\t 1. Setup and configure environment"; blueEcho "\t 2. Setup IDEs"; blueEcho "\t 3. Repair environment and IDEs"; blueEcho "\n\t\tSelect appropriate option "; tput cuf 12; read UTIL_CHOICE; }

5.2.3 selectAndConfigEnvMenu() selectAndConfigEnvMenu() { clear; majentaEcho "\n\n\t\tSELECT YOUR ENVIRONMENT"; majentaEcho "\t------"

Dept of CSE, NHCE 24

Environment Setup for PL

blueEcho "\n\t 1. Java"; blueEcho "\t 2. C\C++"; blueEcho "\t 3. Python"; blueEcho "\t 4. Android" blueEcho "\n\t\tSelect appropriate option "; tput cuf 12; read CONFIGENV_CHOICE; }

5.2.4 testJavaCompiler() testJavaCompiler() { if [ -f "JavaHelloWorld.java" ] then rm JavaHelloWorld.java; fi touch JavaHelloWorld.java;

echo " public class JavaHelloWorld { \n public static void main(String[] args) { \n System.out.println(\"\\t\\t\\tHello World in Java\"); \n } \n }" >> JavaHelloWorld.java;

greenEcho "\n\tWriting hello world program....OK"; javac JavaHelloWorld.java; greenEcho "\n\tCompiling hello world program....OK"; greenEcho "\n\tRunning hello world program....OK\n"; redEcho ""; java JavaHelloWorld; greenEcho "\n\t$1" yellowEcho "\n\n\tPress ENTER to continue." tput cuf 12; read x; }

5.2.5 testCPPCompiler()

testCPPCompiler() { if [ -f "CppHelloWorld.cpp" ]

Dept of CSE, NHCE 25

Environment Setup for PL

then rm CppHelloWorld.cpp; fi touch CppHelloWorld.cpp; echo " #include \n int main(){ \n printf(\"\\t\\tHello World in CPP\"); \n return 0;}" >> CppHelloWorld.cpp; greenEcho "\n\tWriting hello world program....OK";

g++ CppHelloWorld.cpp; greenEcho "\n\tCompiling hello world program....OK"; greenEcho "\n\tRunning hello world program....OK\n"; redEcho ""; ./a.out; greenEcho "\n\n\t$1" yellowEcho "\n\n\tPress ENTER to continue." tput cuf 12; read x;

}

5.2.6 testPythonCompiler() testPythonCompiler()

{ if [ -f "PythonHelloWorld.py" ] then rm PythonHelloWorld.py; fi touch PythonHelloWorld.py; echo "print \"\\t\\t\\tHello world in python\"" >> PythonHelloWorld.py; greenEcho "\n\tRunning hello world program....OK\n"; redEcho ""; python PythonHelloWorld.py; greenEcho "\n\t$1" yellowEcho "\n\n\tPress ENTER to continue." tput cuf 12; read x; }

Dept of CSE, NHCE 26

Environment Setup for PL

5.2.7 configJavaEnv() configJavaEnv()

{ clear; majentaEcho "\n\n\t\t$1"; majentaEcho "\t------" yellowEcho "\tAround 90 MB will be downloaded\n" yellowEcho "\tEnter root password "; case $OS in "Ubuntu") #Command to install JDK on Ubuntu Machine. sudo apt-get install openjdk-8-jdk -y; ;; "Fedora") #Command to install JDK on Fedora Machine. su -c "yum install java-1.8.0-openjdk -y"; ;; esac

#Testing the java compiler after installation of JDK; testJavaCompiler $2;

#Post installation of environment for setting up of IDE for Java. yellowEcho "\tDo you want to install Java IDE?" blueEcho "\n\t1. Eclipse IDE"; blueEcho "\t2. Exit"; tput cuf 12; read x; case $x in 1) setupEclipse;

2)exit;

;; *) redEcho "\n\t\tInvalid Choice Selected !!!! Try again...."; read X; sh "envsetup.sh"; ;;

Dept of CSE, NHCE 27

Environment Setup for PL

esac }

5.2.8 configCPPEnv() configCPPEnv() { clear; majentaEcho "\n\n\t\t$1"; majentaEcho "\t------" yellowEcho "\tAround 50 MB will be downloaded\n" yellowEcho "\tEnter root password "; case $OS in "Ubuntu") #Command to install JDK on Ubuntu Machine. sudo apt-get install gcc g++ -y; ;; "Fedora") #Command to install JDK on Fedora Machine. su -c "yum install gcc g++ -y"; ;; esac

testCPPCompiler "$2"; yellowEcho "\tDo you want to install C and C++ IDE?" blueEcho "\n\t1. Install Qt for C and C++"; blueEcho "\t2. Exit"; tput cuf 12; read x; case $x in 1) setupQt;

2) exit;

*) redEcho "\n\t\tInvalid Choice Selected !!!! Try again...."; read X; sh "envsetup.sh"; ;; esac }

Dept of CSE, NHCE 28

Environment Setup for PL

5.2.9 configPythonEnv()

configPythonEnv() { clear; majentaEcho "\n\n\t\t$1"; majentaEcho "\t------" yellowEcho "\tEnter root password "; case $OS in "Ubuntu") yellowEcho "\tAround 10 MB packages will be downloaded...."; yellowEcho "\n\tPRESS ENTER TO CONTINUE...." read X; #Command to install python on Ubuntu Machine. sudo apt-get install python; ;; "Fedora") yellowEcho "\tAround 10 MB packages will be downloaded...."; yellowEcho "\n\tPRESS ENTER TO CONTINUE...." #Command to install python on Fedora Machine. sudo yum install python; ;; esac testPythonCompiler $2; yellowEcho "\tDo you want to install the Geany the python IDE?" blueEcho "\n\t1. Install Geany IDE for python"; blueEcho "\t2. Exit"; tput cuf 12; read x; case $x in 1) #Setup Qt IDE for C And C++. setupGeany; ;;

2) #exit the script.

Dept of CSE, NHCE 29

Environment Setup for PL

exit; ;; *) redEcho "\n\t\tInvalid Choice Selected !!!! Try again...."; read X; sh "envsetup.sh"; ;; esac }

5.2.10 repairEnv() repairEnv() { selectAndConfigEnvMenu; case "$CONFIGENV_CHOICE" in 1)configJavaEnv "CHECKING AND REPAIRING THE JAVA ENVIRONMENT" "Java-environment-repaired...."; ;; 2) configCPPEnv "CHECKING AND REPAIRING THE C\C++ ENVIRONMENT" "C-Environment-repaired...."; ;; 3) configPythonEnv "CHECKING AND REPAIRING THE PYTHON ENVIRONMENT" "Python-environment-repaired...."; ;; 4)setupAndroidStudio "CHECKING AND REPAIRING THE ANDROID STUDIO" "Android-studio-repaired...."; ;; *)redEcho "\n\t\tInvalid Choice Selected !!!! Try again...."; tput cuf 12; read X; sh "envsetup.sh"; esa

Dept of CSE, NHCE 30

Environment Setup for PL

5.3 The Commands used are as follows:

5.3.1 For Ubuntu OS:

a. Command to install JDK on Ubuntu Machine. sudo apt-get install openjdk-8-jdk -y;

b. Command to install gcc on Ubuntu Machine. sudo apt-get install gcc g++ -y;

c. Command to install python on Ubuntu Machine. sudo apt-get install python;

d. Command to install eclipse on Ubuntu Machine. sudo apt-get install eclipse;

e. Command to install Qt IDE on Ubuntu Machine. sudo apt-get install qtcreator;

f. Command to install geany IDE on Ubuntu Machine. sudo apt-get install geany;

Dept of CSE, NHCE 31

Environment Setup for PL

5.3.2 For Fedora OS:

a. Command to install JDK on Fedora Machine. su -c yum install openjdk-8-jdk -y;

b. Command to install gcc on Fedora Machine. su -c yum install gcc g++ -y;

c. Command to install python on Fedora Machine. su -c yum install python;

d. Command to install eclipse on Fedora Machine. su -c yum install eclipse;

e. Command to install Qt IDE on Fedora Machine. su -c yum install qtcreator;

f. Command to install geany IDE on Fedora Machine. su -c yum install geany;

Dept of CSE, NHCE 32

Environment Setup for PL

CHAPTER 6 TESTING

The purpose of testing is to discover errors. Testing is the process of trying to discover every conceivable fault or weakness in a work product. It provides a way to check the functionality of components, sub-assemblies, assemblies and/or a finished product it is the process of exercising software with the intent of ensuring that the Software system meets its requirements and user expectations and does not fail in an unacceptable manner. There are various types of test. Each test type addresses a specific testing requirement.

TYPES OF TESTING

6.1 UNIT TESTING Unit testing involves the design of test cases that validate that the internal program logic is functioning properly, and that program inputs produce valid outputs. All decision branches and internal code flow should be validated. It is the testing of individual software units of the application .it is done after the completion of an individual unit before integration. This is a structural testing, that relies on knowledge of its construction and is invasive. Unit tests perform basic tests at component level and test a specific business process, application, and/or system configuration. Unit tests ensure that each unique path of a business process performs accurately to the documented specifications and contains clearly defined inputs and expected results. 6.2 INTEGRATION TESTING Integration tests are designed to test integrated software components to determine if they actually run as one program. Testing is event driven and is more concerned with the basic outcome of screens or fields. Integration tests demonstrate that although the components were individually satisfaction, as shown by successfully unit testing, the combination of components is correct and consistent. Integration testing is specifically aimed at exposing the problems that arise from the combination of components.

Dept of CSE, NHCE 33

Environment Setup for PL

6.3 VALIDATION TESTING

An engineering validation test (EVT) is performed on first engineering prototypes, to ensure that the basic unit performs to design goals and specifications. It is important in identifying design problems, and solving them as early in the design cycle as possible, is the key to keeping projects on time and within budget. Too often, product design and performance problems are not detected until late in the product development cycle — when the product is ready to be shipped. The old adage holds true: It costs a penny to make a change in engineering, a dime in production and a dollar after a product is in the field.

Verification is a Quality control process that is used to evaluate whether or not a product, service, or system complies with regulations, specifications, or conditions imposed at the start of a development phase. Verification can be in development, scale- up, or production. This is often an internal process.

Validation is a Quality assurance process of establishing evidence that provides a high degree of assurance that a product, service, or system accomplishes its intended requirements. This often involves acceptance of fitness for purpose with end users and other product stakeholders.

The testing process overview is as follows:

Figure 6.1: The testing process

Dept of CSE, NHCE 34

Environment Setup for PL

6.4 SYSTEM TESTING

System testing of software or hardware is testing conducted on a complete, integrated system to evaluate the system's compliance with its specified requirements. System testing falls within the scope of black box testing, and as such, should require no knowledge of the inner design of the code or logic.

As a rule, system testing takes, as its input, all of the "integrated" software components that have successfully passed integration testing and also the software system itself integrated with any applicable hardware system(s).

System testing is a more limited type of testing; it seeks to detect defects both within the "inter-assemblages" and also within the system as a whole.

System testing is performed on the entire system in the of a Functional Requirement Specification(s) (FRS) and/or a System Requirement Specification (SRS).

System testing tests not only the design, but also the behavior and even the believed expectations of the customer. It is also intended to test up to and beyond the bounds defined in the software/hardware requirements specification(s).

The following examples are different types of testing that should be considered during System testing:

testing

 Usability testing

 Software performance testing

 Compatibility testing

 Load testing

 Volume testing

 Stress testing

Dept of CSE, NHCE 35

Environment Setup for PL

6.5 TESTING OF SHELL SCRIPT PROGRAM

Serial Number of Test Case TC 01

Module Under Test Menu to show OS selection ,Utilities selection and Programming language selection.

Description The user selects his choice of OS, Environment Utilities and the programming language of his choice.

Output Successful selection of the desired option.

Remarks Test Successful.

Table 6.1: Test case for Menu Selection

Dept of CSE, NHCE 36

Environment Setup for PL

Serial Number of Test Case TC 02

Module Under Test Java compiler ,C++ compiler, Python compiler Description A simple Hello World program will be executed to check the working of the above mentioned compilers.

Input Hello World program in the respective programming language.

Output Display of the message “HELLO WORLD”

Remarks Test Successful.

Table 6.2: Test Case for working of compilers.

Dept of CSE, NHCE 37

Environment Setup for PL

Serial Number of Test Case TC 03

Module Under Test Configuration of Java ,C++/C and Python environments.

Description Installation of environments and its dependencies for the above mentioned programming langauges.

Input Commands to install the above in Unix like OS (Fedora,Fedora).

Output Successful installation of the environment and its dependencies.

Remarks Test Successful.

Table 6.3: Test Case for Configuration of environments.

Dept of CSE, NHCE 38

Environment Setup for PL

Serial Number of Test Case TC 04

Module Under Test Setup of IDE’S for the included programming langauges.

Description The user has to select one of the below IDE: 1) Android Studio for Android 2) Eclipse for Java. 3) QT for C AND C++. 4)Geany for Python. Input User selects any one of the above mentioned IDE.

Output Installation of the selected IDE.

Remarks Test Successful.

Table 6.4: Test Case for IDE Setup.

Dept of CSE, NHCE 39

Environment Setup for PL

Serial Number of Test Case TC 05

Module Under Test Verification of Repair Environment function. Description When the user selects the repair environment function , the repairEnv() function should be able to repair the environment.

Input Envirnment to be repaired.

Output Successfull repair of the selected environment.

Remarks Test Successful.

Table 6.5: Test Case for Repair Environment.

Dept of CSE, NHCE 40

Environment Setup for PL

CHAPTER 7

SNAPSHOT

Fig 7.1 Screen Layout of OS Menu

Fig 7.2 Screen Layout of Utilities Menu.

Dept of CSE, NHCE 41

Environment Setup for PL

Fig 7.3 Screen Layout of Environment Menu.

Fig 7.3 Screen Layout of IDE Menu.

Dept of CSE, NHCE 42

Environment Setup for PL

Fig 7.4 Snapshot of Android Studio IDE.

Fig 7.5 Screen Layout Geany IDE.

Dept of CSE, NHCE 43

Environment Setup for PL

Fig 7.6 Screen Layout of QT IDE.

Fig 7.7 Snapshot of Eclipse IDE.

Dept of CSE, NHCE 44

Environment Setup for PL

CHAPTER 8 CONCLUSION AND FUTURE ENHANCEMENT

8.1 CONCLUSION

In this paper we have worked to facilitate the client in getting the desired environment setup and the installation of its dependencies such as IDE. Our scheme was developed to reduce the computational overhead of the experienced as well as the novice client.We also enhanced the efficiency of the system by introducing single line commands for the working of one entire function thereby reducing time complexity and increasing the utilization and efficiency of the program. Many of the schemes proposed earlier require the archive to perform tasks that need a lot of computational power to download and install the IDE’s . But in our project the shell script just needed to fetch and install few Megabytes of the necessary setup software.

8.2 FUTURE ENHANCEMENT  Facility for updating the environment.  Access of the IDE without the requirement of SUPERUSER access.  Facility to determine the architecture of the system before installing the necessary software.  More interactive user interface.  Facilities for Backup creation.

Dept of CSE, NHCE 45

Environment Setup for PL

BIBLIOGRAPHY

REFERENCE PAPERS:

 OM Ritchie, K Thompson - Bell System Technical Journal, The, 1978 - ieeexplore.ieee.org.

 MD McIlroy, EN Pinson - System Technical Journal, 1978 - Wiley Online Library.

TEXT BOOKS:

 Linux Shell Scripting Tutorial - A Beginner's handbook.

 Bourne / Bash shell programming tutorial by Steve Parker.

SITES REFERRED:

http://www.linuxcommand.org

http://www.comptechdoc.org

http://www.techmint.org

www.linuxquestions.org › Forums › Linux Forums › Linux – Distributions

https://ask.fedoraproject.org/

https://en.wikipedia.org/

Dept of CSE, NHCE 46