SlideShare a Scribd company logo
THE BASIC TOOLS
Oğuzhan Şahin
25/06/2019
Titles
-The Power of Plain Text
-Shell Games
-Power Editing
-Source Code Control
-Debugging
-Text Manipulation
Plain text is made up of
printable
characters in a form
that
can be read and understood
by people.
The majority of files and
documents created as Plaintext
on Windows operating systems
DRAWBACK OF USING PLAIN TEXT
There are two major drawbacks to using plain text:
It may take more space to store than a compressed binary format,
It may be computationally more expensive to interpret and process
a plain text file.
POWER OF PLAIN TEXT
1-Insurance against obsolescence
<FIELD10>123-45-6789</FIELD10> ...
<FIELD10>567-89-0123</FIELD10> ...
<FIELD10>901-23-4567</FIELD10>
Recognizing the format of a Social Security number, you can quickly write a small program to
extract that data—even if you have no information on anything else in the file.
AC27123456789B11P ...
XY43567890123QTYL ...
6T2190123456788AM
You may not have recognized the significance of the
numbers quite as easily..
2-Leverage
Virtually every tool in the computing universe, from source code management systems
to compiler environments to editors and stand-alone filters, can operate on plain text.
For instance, suppose you have a production deployment of a large application with a
complex site-specific configuration file (sendmail comes to mind). If this file is in plain text,
you could place it under a source code control system (see Source Code Control, page 86),
so that you automatically keep a history of all changes.
3-Easier Testing
If you use plain text to create synthetic data to drive system tests, then it is a simple matter to
add, update, or modify the test data without having to create any special tools to do so.
Similarly, plain text output from regression tests can be trivially analyzed (with diff, for
instance) or subjected to more thorough scrutiny with Perl, Python, or some other scripting
tool.
SHELL GAMES
A benefit of GUIs is WYSIWYG —what you see is what
you get
The disadvantage is WYSIAYG—what you see is all you
get.
Find all .c files modified more recently than your Makefile.
Shell . . .
find . -name ’*.c’ -newer Makefile -print
GUI. . . . .
Open the Explorer, navigate to the correct directory,
click on the Makefile, and note the modification time.
Then bring up Tools/Find, and enter *.c for the file specification.
Select the date tab, and enter the date you noted for the Makefile
Construct a zip/tar archive of my source.
Shell . . .
zip archive.zip *.h *.c – or – tar cvf archive.tar *.h *.c
GUI. . . . . Bring up a ZIP utility (such as the shareware WinZip [URL 41]),
select “Create New Archive,” enter its name, select the source directory in the add dialog,
set the filter to “*.c”, click “Add,” set the filter to “*.h”, click “Add,” then close the archive.
Which Java files have not been changed in the last week?
Shell . . .
find . -name ’*.java’ -mtime +7 -print
GUI. . . . . Click and navigate to “Find files,” click the “Named” field and type in “*.java”,
Select the “Date Modified” tab.
Then select “Between.”
Click on the starting date and type in the starting date of the beginning of the project.
Click on “Find Now.”
Of those files, which use the awt libraries?
Shell . . .
find . -name ’*.java’ -mtime +7 -print | xargs grep ’java.awt’
GUI. . . . . Load each file in the list from the previous example into an editor and
search for the string “java.awt”.
Write down the name of each file containing a match
POWER EDITING
USE A SINGLE EDITOR WELL
Choose an editor, know it throughly, and use it for all editing
tasks. If you use a single editor across all text editing activities,
you don’t have to stop and think to accomplish text manipulation:
the necessary keystrokes will be a reflex.
Make sure that the editor you choose is available on all platforms
you use. Emacs, vi, CRiSP, Brief, and others are available across
multiple platforms, often in both GUI and non-GUI versions.
EDITOR FEATURES
Configurable : All aspects of the editor should be configurable to
your preferences, including fonts, colors, window sizes, and keystroke
bindings (which keys perform what commands). Using only keystrokes
for common editing operations is more efficient than mouse or menu-
driven commands, because your hands never leave the keyboard.
● Extensible: An editor shouldn’t be obsolete just because a
new programming language comes out. It should be able to
integrate with whatever compiler environment you are using.
You should be able to “teach” it the nuances of any new
language or text format (XML, HTML version 9, and so on).
● Programmable : You should be able to program the editor to
perform complex, multistep tasks. This can be done with
macros or with a built-in scripting programming language
(Emacs uses a variant of Lisp, for instance).
SOURCE CODE CONTROL
One of the important things
we look for in a user
interface is the UNDO key—
a single button that
forgives us our mistakes.
But My Team Isn’t Using Source Code
Control
DEBUGGING
It is a painful thing
To look at your own trouble and
know
That you yourself and no one else
has made it
Sophocles, Ajax
The word bug has been used to describe an “object of terror” ever
since the fourteenth century. Rear Admiral Dr. Grace Hopper, the
inventor of COBOL, is credited with observing the first computer bug—
literally, a moth caught in a relay in an early computer system. When
asked to explain why the machine wasn’t behaving as intended, a
technician reported that there was “a bug in the system,” and dutifully
taped it— wings and all—into the log book.
Psychology of Debugging
➢ Debugging itself is a sensitive, emotional subject for many developers.
Instead of attacking it as a puzzle to be solved, you may encounter
denial, finger pointing, lame excuses, or just plain apathy.
➢ Embrace the fact that debugging is just problem solving, and attack it
as such. Having found someone else’s bug, you can spend time and
energy laying blame on the filthy culprit who created it.
DON’T PANIC !!!!!
Debugging Strategies
● Visualize Your Data
Ada, C, C++, Fortran, Java, Modula,
Pascal, Perl, and Python
Tracing
Debuggers generally focus on the state of the program now. Sometimes you
need more—you need to watch the state of a program or a data structure over
time.
Tracing statements are those little diagnostic messages you print to the
screen or to a file that say things such as “got here” and “value of x = 2.” It’s a
primitive technique compared with IDE-style debuggers, but it is peculiarly
effective at diagnosing several classes of errors that debuggers can’t.
Tracing is invaluable in any system where time itself is a factor: concurrent
processes, real-time systems.
TRACE
Rubber Ducking
Text Manipulation
● Database schema maintenance: A set of Perl scripts took a plain text file
containing a database schema definition and from it generated:
– The SQL statements to create the database
– Flat data files to populate a data dictionary
– C code libraries to access the database
– Scripts to check database integrity – Web pages containing schema
descriptions and diagrams – An XML version of the schema
➢ Generating Web documentation. Many project teams are publishing their
documentation to internal Web sites.
➢ We have written many Perl programs that analyze database schemas, C or C++
source files, makefiles, and other project sources to produce the required HTML
documentation.
➢ We also use Perl to wrap the documents with standard headers and footers, and
to transfer them to the Web site
C to Object Pascal interface: A client had a team of developers writing Object
Pascal on PCs. Their code needed to interface to a body of code written in C.
We developed a short Perl script that parsed the C header files, extracting the
definitions of all exported functions and the data structures they used.
We then generated Object Pascal units with Pascal records for all the C structures,
and imported procedure definitions for all the C functions.
This generation process became part of the build, so that whenever the C header
changed, a new Object Pascal unit would be constructed automatically.
REFERENCES
The Pragmatic Programmer. From Journeyman to Master. Andrew Hunt.
David Thomas. ADDISON–WESLEY. An imprint of Addison Wesley
Longman, Inc

More Related Content

Similar to THE BASIC TOOLS

How to work with code blocks
How to work with code blocksHow to work with code blocks
How to work with code blocks
Tech Bikram
 
The pragmatic programmer
The pragmatic programmerThe pragmatic programmer
The pragmatic programmer
LeylimYaln
 
The UNIX philosophy
The UNIX philosophyThe UNIX philosophy
The UNIX philosophy
Kevin Maiyo
 
C++Basics2022.pptx
C++Basics2022.pptxC++Basics2022.pptx
C++Basics2022.pptx
Danielle780357
 
Machine learning in cybersecutiry
Machine learning in cybersecutiryMachine learning in cybersecutiry
Machine learning in cybersecutiry
Vishwas N
 
Computer and multimedia Week 1 Windows Architecture.pptx
Computer and multimedia Week 1 Windows Architecture.pptxComputer and multimedia Week 1 Windows Architecture.pptx
Computer and multimedia Week 1 Windows Architecture.pptx
fatahozil
 
C in7-days
C in7-daysC in7-days
C in7-days
Sanuj Nair
 
C in7-days
C in7-daysC in7-days
C in7-days
Amit Kapoor
 
outgoing again
outgoing againoutgoing again
outgoing again
spredslide
 
программное обеспечение (по)
программное обеспечение (по) программное обеспечение (по)
программное обеспечение (по)
victoria_4
 
Programming in c_in_7_days
Programming in c_in_7_daysProgramming in c_in_7_days
Programming in c_in_7_days
Ankit Dubey
 
Chapter 1: Introduction to Command Line
Chapter 1: Introduction to  Command LineChapter 1: Introduction to  Command Line
Chapter 1: Introduction to Command Line
azzamhadeel89
 
.Net Debugging Techniques
.Net Debugging Techniques.Net Debugging Techniques
.Net Debugging Techniques
Bala Subra
 
.NET Debugging Tips and Techniques
.NET Debugging Tips and Techniques.NET Debugging Tips and Techniques
.NET Debugging Tips and Techniques
Bala Subra
 
Introduction to Software Build Technology
Introduction to Software Build TechnologyIntroduction to Software Build Technology
Introduction to Software Build Technology
Philip Johnson
 
Chapter 1: Introduction to Command Line
Chapter 1: Introduction  to Command LineChapter 1: Introduction  to Command Line
Chapter 1: Introduction to Command Line
azzamhadeel89
 
Command line for the beginner - Using the command line in developing for the...
Command line for the beginner -  Using the command line in developing for the...Command line for the beginner -  Using the command line in developing for the...
Command line for the beginner - Using the command line in developing for the...
Jim Birch
 
ID E's features
ID E's featuresID E's features
ID E's features
wajahat Gul
 
The seven pillars of aspnet
The seven pillars of aspnetThe seven pillars of aspnet
The seven pillars of aspnet
Nethaji Naidu
 
Introduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdfIntroduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdf
AnassElHousni
 

Similar to THE BASIC TOOLS (20)

How to work with code blocks
How to work with code blocksHow to work with code blocks
How to work with code blocks
 
The pragmatic programmer
The pragmatic programmerThe pragmatic programmer
The pragmatic programmer
 
The UNIX philosophy
The UNIX philosophyThe UNIX philosophy
The UNIX philosophy
 
C++Basics2022.pptx
C++Basics2022.pptxC++Basics2022.pptx
C++Basics2022.pptx
 
Machine learning in cybersecutiry
Machine learning in cybersecutiryMachine learning in cybersecutiry
Machine learning in cybersecutiry
 
Computer and multimedia Week 1 Windows Architecture.pptx
Computer and multimedia Week 1 Windows Architecture.pptxComputer and multimedia Week 1 Windows Architecture.pptx
Computer and multimedia Week 1 Windows Architecture.pptx
 
C in7-days
C in7-daysC in7-days
C in7-days
 
C in7-days
C in7-daysC in7-days
C in7-days
 
outgoing again
outgoing againoutgoing again
outgoing again
 
программное обеспечение (по)
программное обеспечение (по) программное обеспечение (по)
программное обеспечение (по)
 
Programming in c_in_7_days
Programming in c_in_7_daysProgramming in c_in_7_days
Programming in c_in_7_days
 
Chapter 1: Introduction to Command Line
Chapter 1: Introduction to  Command LineChapter 1: Introduction to  Command Line
Chapter 1: Introduction to Command Line
 
.Net Debugging Techniques
.Net Debugging Techniques.Net Debugging Techniques
.Net Debugging Techniques
 
.NET Debugging Tips and Techniques
.NET Debugging Tips and Techniques.NET Debugging Tips and Techniques
.NET Debugging Tips and Techniques
 
Introduction to Software Build Technology
Introduction to Software Build TechnologyIntroduction to Software Build Technology
Introduction to Software Build Technology
 
Chapter 1: Introduction to Command Line
Chapter 1: Introduction  to Command LineChapter 1: Introduction  to Command Line
Chapter 1: Introduction to Command Line
 
Command line for the beginner - Using the command line in developing for the...
Command line for the beginner -  Using the command line in developing for the...Command line for the beginner -  Using the command line in developing for the...
Command line for the beginner - Using the command line in developing for the...
 
ID E's features
ID E's featuresID E's features
ID E's features
 
The seven pillars of aspnet
The seven pillars of aspnetThe seven pillars of aspnet
The seven pillars of aspnet
 
Introduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdfIntroduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdf
 

Recently uploaded

Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
VALiNTRY360
 
zOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL DifferenceszOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL Differences
YousufSait3
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
Preparing Non - Technical Founders for Engaging a Tech Agency
Preparing Non - Technical Founders for Engaging  a  Tech AgencyPreparing Non - Technical Founders for Engaging  a  Tech Agency
Preparing Non - Technical Founders for Engaging a Tech Agency
ISH Technologies
 
YAML crash COURSE how to write yaml file for adding configuring details
YAML crash COURSE how to write yaml file for adding configuring detailsYAML crash COURSE how to write yaml file for adding configuring details
YAML crash COURSE how to write yaml file for adding configuring details
NishanthaBulumulla1
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !
Marcin Chrost
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
Peter Muessig
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
Bert Jan Schrijver
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
Remote DBA Services
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
Hornet Dynamics
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
mz5nrf0n
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
ToXSL Technologies
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
dakas1
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
Quickdice ERP
 
SQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure MalaysiaSQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure Malaysia
GohKiangHock
 
Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
TaghreedAltamimi
 

Recently uploaded (20)

Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
 
zOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL DifferenceszOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL Differences
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
Preparing Non - Technical Founders for Engaging a Tech Agency
Preparing Non - Technical Founders for Engaging  a  Tech AgencyPreparing Non - Technical Founders for Engaging  a  Tech Agency
Preparing Non - Technical Founders for Engaging a Tech Agency
 
YAML crash COURSE how to write yaml file for adding configuring details
YAML crash COURSE how to write yaml file for adding configuring detailsYAML crash COURSE how to write yaml file for adding configuring details
YAML crash COURSE how to write yaml file for adding configuring details
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
 
SQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure MalaysiaSQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure Malaysia
 
Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
 

THE BASIC TOOLS

  • 1. THE BASIC TOOLS Oğuzhan Şahin 25/06/2019
  • 2.
  • 3. Titles -The Power of Plain Text -Shell Games -Power Editing -Source Code Control -Debugging -Text Manipulation
  • 4. Plain text is made up of printable characters in a form that can be read and understood by people. The majority of files and documents created as Plaintext on Windows operating systems
  • 5. DRAWBACK OF USING PLAIN TEXT There are two major drawbacks to using plain text: It may take more space to store than a compressed binary format, It may be computationally more expensive to interpret and process a plain text file.
  • 6. POWER OF PLAIN TEXT 1-Insurance against obsolescence <FIELD10>123-45-6789</FIELD10> ... <FIELD10>567-89-0123</FIELD10> ... <FIELD10>901-23-4567</FIELD10> Recognizing the format of a Social Security number, you can quickly write a small program to extract that data—even if you have no information on anything else in the file. AC27123456789B11P ... XY43567890123QTYL ... 6T2190123456788AM You may not have recognized the significance of the numbers quite as easily..
  • 7. 2-Leverage Virtually every tool in the computing universe, from source code management systems to compiler environments to editors and stand-alone filters, can operate on plain text. For instance, suppose you have a production deployment of a large application with a complex site-specific configuration file (sendmail comes to mind). If this file is in plain text, you could place it under a source code control system (see Source Code Control, page 86), so that you automatically keep a history of all changes.
  • 8. 3-Easier Testing If you use plain text to create synthetic data to drive system tests, then it is a simple matter to add, update, or modify the test data without having to create any special tools to do so. Similarly, plain text output from regression tests can be trivially analyzed (with diff, for instance) or subjected to more thorough scrutiny with Perl, Python, or some other scripting tool.
  • 10. A benefit of GUIs is WYSIWYG —what you see is what you get The disadvantage is WYSIAYG—what you see is all you get.
  • 11. Find all .c files modified more recently than your Makefile. Shell . . . find . -name ’*.c’ -newer Makefile -print GUI. . . . . Open the Explorer, navigate to the correct directory, click on the Makefile, and note the modification time. Then bring up Tools/Find, and enter *.c for the file specification. Select the date tab, and enter the date you noted for the Makefile
  • 12. Construct a zip/tar archive of my source. Shell . . . zip archive.zip *.h *.c – or – tar cvf archive.tar *.h *.c GUI. . . . . Bring up a ZIP utility (such as the shareware WinZip [URL 41]), select “Create New Archive,” enter its name, select the source directory in the add dialog, set the filter to “*.c”, click “Add,” set the filter to “*.h”, click “Add,” then close the archive.
  • 13. Which Java files have not been changed in the last week? Shell . . . find . -name ’*.java’ -mtime +7 -print GUI. . . . . Click and navigate to “Find files,” click the “Named” field and type in “*.java”, Select the “Date Modified” tab. Then select “Between.” Click on the starting date and type in the starting date of the beginning of the project. Click on “Find Now.”
  • 14. Of those files, which use the awt libraries? Shell . . . find . -name ’*.java’ -mtime +7 -print | xargs grep ’java.awt’ GUI. . . . . Load each file in the list from the previous example into an editor and search for the string “java.awt”. Write down the name of each file containing a match
  • 15. POWER EDITING USE A SINGLE EDITOR WELL Choose an editor, know it throughly, and use it for all editing tasks. If you use a single editor across all text editing activities, you don’t have to stop and think to accomplish text manipulation: the necessary keystrokes will be a reflex. Make sure that the editor you choose is available on all platforms you use. Emacs, vi, CRiSP, Brief, and others are available across multiple platforms, often in both GUI and non-GUI versions.
  • 16. EDITOR FEATURES Configurable : All aspects of the editor should be configurable to your preferences, including fonts, colors, window sizes, and keystroke bindings (which keys perform what commands). Using only keystrokes for common editing operations is more efficient than mouse or menu- driven commands, because your hands never leave the keyboard.
  • 17. ● Extensible: An editor shouldn’t be obsolete just because a new programming language comes out. It should be able to integrate with whatever compiler environment you are using. You should be able to “teach” it the nuances of any new language or text format (XML, HTML version 9, and so on). ● Programmable : You should be able to program the editor to perform complex, multistep tasks. This can be done with macros or with a built-in scripting programming language (Emacs uses a variant of Lisp, for instance).
  • 18. SOURCE CODE CONTROL One of the important things we look for in a user interface is the UNDO key— a single button that forgives us our mistakes.
  • 19. But My Team Isn’t Using Source Code Control
  • 20. DEBUGGING It is a painful thing To look at your own trouble and know That you yourself and no one else has made it Sophocles, Ajax
  • 21. The word bug has been used to describe an “object of terror” ever since the fourteenth century. Rear Admiral Dr. Grace Hopper, the inventor of COBOL, is credited with observing the first computer bug— literally, a moth caught in a relay in an early computer system. When asked to explain why the machine wasn’t behaving as intended, a technician reported that there was “a bug in the system,” and dutifully taped it— wings and all—into the log book.
  • 23. ➢ Debugging itself is a sensitive, emotional subject for many developers. Instead of attacking it as a puzzle to be solved, you may encounter denial, finger pointing, lame excuses, or just plain apathy. ➢ Embrace the fact that debugging is just problem solving, and attack it as such. Having found someone else’s bug, you can spend time and energy laying blame on the filthy culprit who created it.
  • 25. Debugging Strategies ● Visualize Your Data Ada, C, C++, Fortran, Java, Modula, Pascal, Perl, and Python
  • 26.
  • 27. Tracing Debuggers generally focus on the state of the program now. Sometimes you need more—you need to watch the state of a program or a data structure over time. Tracing statements are those little diagnostic messages you print to the screen or to a file that say things such as “got here” and “value of x = 2.” It’s a primitive technique compared with IDE-style debuggers, but it is peculiarly effective at diagnosing several classes of errors that debuggers can’t. Tracing is invaluable in any system where time itself is a factor: concurrent processes, real-time systems.
  • 28. TRACE
  • 31. ● Database schema maintenance: A set of Perl scripts took a plain text file containing a database schema definition and from it generated: – The SQL statements to create the database – Flat data files to populate a data dictionary – C code libraries to access the database – Scripts to check database integrity – Web pages containing schema descriptions and diagrams – An XML version of the schema
  • 32. ➢ Generating Web documentation. Many project teams are publishing their documentation to internal Web sites. ➢ We have written many Perl programs that analyze database schemas, C or C++ source files, makefiles, and other project sources to produce the required HTML documentation. ➢ We also use Perl to wrap the documents with standard headers and footers, and to transfer them to the Web site
  • 33. C to Object Pascal interface: A client had a team of developers writing Object Pascal on PCs. Their code needed to interface to a body of code written in C. We developed a short Perl script that parsed the C header files, extracting the definitions of all exported functions and the data structures they used. We then generated Object Pascal units with Pascal records for all the C structures, and imported procedure definitions for all the C functions. This generation process became part of the build, so that whenever the C header changed, a new Object Pascal unit would be constructed automatically.
  • 34. REFERENCES The Pragmatic Programmer. From Journeyman to Master. Andrew Hunt. David Thomas. ADDISON–WESLEY. An imprint of Addison Wesley Longman, Inc