We are independent & ad-supported. We may earn a commission for purchases made through our links.
Advertiser Disclosure
Our website is an independent, advertising-supported platform. We provide our content free of charge to our readers, and to keep it that way, we rely on revenue generated through advertisements and affiliate partnerships. This means that when you click on certain links on our site and make a purchase, we may earn a commission. Learn more.
How We Make Money
We sustain our operations through affiliate commissions and advertising. If you click on an affiliate link and make a purchase, we may receive a commission from the merchant at no additional cost to you. We also display advertisements on our website, which help generate revenue to support our work and keep our content free for readers. Our editorial team operates independently of our advertising and affiliate partnerships to ensure that our content remains unbiased and focused on providing you with the best information and recommendations based on thorough research and honest evaluations. To remain transparent, we’ve provided a list of our current affiliate partners here.
Technology

Our Promise to you

Founded in 2002, our company has been a trusted resource for readers seeking informative and engaging content. Our dedication to quality remains unwavering—and will never change. We follow a strict editorial policy, ensuring that our content is authored by highly qualified professionals and edited by subject matter experts. This guarantees that everything we publish is objective, accurate, and trustworthy.

Over the years, we've refined our approach to cover a wide range of topics, providing readers with reliable and practical advice to enhance their knowledge and skills. That's why millions of readers turn to us each year. Join us in celebrating the joy of learning, guided by standards you can trust.

What is Program Slicing?

Malcolm Tatum
By
Updated: Feb 08, 2024
Views: 10,701
Share

In software applications, program slicing is a method of identifying the core elements of a software program and gently extracting them from the more complicated code that allows the program to function. This is especially important to software engineering efforts, as it allows the software engineer to find the way through complicated strings of code in order to access the source code that actually drives the application. Being able to extract these subprograms and view the source code makes it possible to identify a wide range of potential bugs and thus make the software run with more efficiency.

It is not unusual for code to be intentionally complicated. One of the main reasons for this action is that the more complicated portions of the code help to protect the source code from corruption by viruses and hacking attempts. Usually, a programmer will add a great deal of extra code that essentially makes it necessary to go through a number of extra steps to accomplish what could be managed by the source code with only a few steps. While this is a desirable state from the perspective of protecting the software from possible corruption, there are situations where there is a need to get to the source code. That is where program slicing comes into play.

There are two basic approaches or dimensions to program slicing. The semantic dimension focuses on the elements of the code string that are necessary and thus will be retained. Both static and dynamic functions are identified and preserved by making use of specific methods of slicing that leave behind the essential elements but remove much of the code inserted as part of the masking process. With semantic program slicing, the engineer has a fair amount of discretion in deciding what, if any, of the extra code actually remains.

Syntactic program slicing does not provide the engineer with the same amount of options. With this approach, anything that is not essential to the core function of the code is removed. If a string is found to serve no real purpose and does not have any impact on the semantics of interest found in the code, it goes. This approach helps to preserve the original syntax of the program without any extra frills.

A second and increasingly common use of syntactic program slicing is known as amorphous program slicing. With this approach, the goal is to make it possible for the slice to continue working with any syntactic function that helps to maintain the semantic constraints that the engineer wishes to preserve in the code.

Share
WiseGeek is dedicated to providing accurate and trustworthy information. We carefully select reputable sources and employ a rigorous fact-checking process to maintain the highest standards. To learn more about our commitment to accuracy, read our editorial process.
Malcolm Tatum
By Malcolm Tatum
Malcolm Tatum, a former teleconferencing industry professional, followed his passion for trivia, research, and writing to become a full-time freelance writer. He has contributed articles to a variety of print and online publications, including WiseGeek, and his work has also been featured in poetry collections, devotional anthologies, and newspapers. When not writing, Malcolm enjoys collecting vinyl records, following minor league baseball, and cycling.

Editors' Picks

Discussion Comments
By anon48036 — On Oct 09, 2009

please give details with part by part and with example in each part. After all many, many thanks to your organization.

Malcolm Tatum
Malcolm Tatum
Malcolm Tatum, a former teleconferencing industry professional, followed his passion for trivia, research, and writing...
Learn more
Share
https://www.wise-geek.com/what-is-program-slicing.htm
Copy this link
WiseGeek, in your inbox

Our latest articles, guides, and more, delivered daily.

WiseGeek, in your inbox

Our latest articles, guides, and more, delivered daily.