CCE Theses and Dissertations

Campus Access Only

All rights reserved. This publication is intended for use solely by faculty, students, and staff of Nova Southeastern University. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, now known or later developed, including but not limited to photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the author or the publisher.

Date of Award

2012

Document Type

Dissertation - NSU Access Only

Degree Name

Doctor of Philosophy in Computer Science (CISD)

Department

Graduate School of Computer and Information Sciences

Advisor

Gregory Simco

Committee Member

Sumitra Mukherjee

Committee Member

Francisco Mitropoulos

Keywords

black-box testing, code clone, functional testing

Abstract

Code clone Discovery Based on Functional Behavior

by

Ronald M Krawitz

2012

Legacy programs are used for many years and experience many cycles of use-maintenance-use-maintenance-use-etc. Source code or source code functionality is frequently replicated within these programs when it is written, as well as when it is maintained. Over time many different developers with greater or lesser understanding of the source code maintain the source code. Maintenance developers, when they have limited time or lack understanding of the program, frequently resort to short cuts that include cutting and pasting existing code and re-implementing functionality instead of refactoring. This means a specific functionality is often repeated several times, sometimes using different source code. Blocks of replicated source code or source code functionality are called code clones. Removing code clones improves extensibility, maintainability, and reusability of a program in addition to making the program more easily understood.

It is generally accepted that four types of code clones exist. Type-1 and Type-2 code clones are comparatively straightforward to locate and tools exist to locate them. However, Type-3 and Type-4 code clones are very difficult to locate with only a few specialized tools capable of locating them with a lower level of precision.

This dissertation presents a new methodology that discovered code clones by studying the functional behavior of blocks of code. Code Clone Discovery based on Functional Behavior (FCD) located code clone by comparing how the blocks of code reacted to various inputs. FCD stimulated the code blocks with the same input patterns and compared the resulting outputs. When a significant portion of the outputs matched, those blocks were declared to be a code clone candidate. Manual analysis confirmed that those blocks of code were code clones. Since FCD discovered code clones based on their black-box behavior, the actual source code syntax was irrelevant and manual inspection further confirmed FCD located code clones that included Type-3 and Type-4 code clones which are frequently excluded from code clone detection tools. FCD recognized the code clones regardless of whether or not they use identical code, similar code, or totally dissimilar code. This new technique allows for an improvement in software quality and has the potential to significantly reduce the cost of software over its lifetime.

To access this thesis/dissertation you must have a valid nova.edu OR mynsu.nova.edu email address and create an account for NSUWorks.

Free My Thesis

If you are the author of this work and would like to grant permission to make it openly accessible to all, please click the Free My Thesis button.

  Contact Author

  Link to NovaCat

Share

COinS