Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Software Archaeology and Code Refactoring with Rational Developer for System z (RDz)


Published on

Presented at the North Florida Rational User Group, March 25, 2014

Refactoring is a rather new term in the COBOL world. It is something that the Java, .NET, PHP, and Python developers have been doing this for years. In the COBOL world, there are countless programs that appear to have stopped maturing once they've gone into production. Refactoring can make your applications more manageable, and stable over time.

Software archaeology is the process by which you discover what you've got, what you've forgotten, and where code originates.

In this meeting, we'll how a z/OS developer can use these strategies with RDz to improve their code, and their productivity using RDz. We'll focus on the new features of the COBOL and PL/I editors, performance hierarchy diagrams, code generation wizards, the Software Analyzer code review features, and MVS tooling that allows the developer to work with partitioned and sequential datasets, VSAM files, and GDG's.

Published in: Technology
  • ⇒⇒⇒ ⇐⇐⇐ has really great writers to help you get the grades you need, they are fast and do great research. Support will always contact you if there is any confusion with the requirements of your paper so they can make sure you are getting exactly what you need.
    Are you sure you want to  Yes  No
    Your message goes here
  • ⇒ ⇐ is a good website if you’re looking to get your essay written for you. You can also request things like research papers or dissertations. It’s really convenient and helpful.
    Are you sure you want to  Yes  No
    Your message goes here
  • I like this service ⇒ ⇐ from Academic Writers. I don't have enough time write it by myself.
    Are you sure you want to  Yes  No
    Your message goes here
  • Take the highest paid surveys! ➜➜➜
    Are you sure you want to  Yes  No
    Your message goes here
  • I can definitely recommend a website that really helped me with my essay. I found out it was due the day before I had to submit it. Went into full-on panic mode. Worst experience of my senior year by far. It’s called ⇒ ⇐. The quality of the writing is passable but the completion rate is super quick. You get to pick your own writer to do your stuff and that’s also a big bonus.
    Are you sure you want to  Yes  No
    Your message goes here

Software Archaeology and Code Refactoring with Rational Developer for System z (RDz)

  1. 1. About Us: Strongback Consulting • IBM Advanced Business Partner – Rational, WebSphere, Lotus, Information Management SVP certified – Strongly focused on Enterprise Modernization and application lifecycle management – Key Industries Served: Finance, Insurance, Healthcare, Manufacturing, Government – Rational Design Partner for HATS and other Rational enterprise modernization technologies Discover us at: Subscribe to us at Socialize with us on Facebook & LinkedIn
  2. 2. Agenda • The view from the programmer analyst • How to conduct archaeology on your source code • Analytic tooling within Rational Developer for System z 3
  3. 3. 4 A day in the life of a software archaeologist
  4. 4. What the code reminds you of…. 5
  5. 5. Definition: White Elephant 6 A white elephant is an idiom for a valuable but burdensome possession of which its owner cannot dispose and whose cost (particularly cost of upkeep) is out of proportion to its usefulness or worth. Source:
  6. 6. The white elephant: 12,000 lines of spaghetti • Where do you start? • Unpredictable abends • Hard to navigate • Difficult to create a “mental map” • Potentially lots of dead code • Out of date comments 7
  7. 7. 8
  8. 8. Rational Developer for System z v9.0 The modern development environment for the modern mainframe “Working across several source code files and copy books– and debugging at the same time!– is game changing.” COBOL Application Programmer 9 Modern IDE features to pull-in new developers to System z application development with rich, modern development for COBOL, PL/I, Java, JCL, CICS, IMS, Batch, Stored Procedure Powerful, easy to use editors with immediate, inline assistance and navigation of host-based resources Build & debug across complex application layers and boundaries Design, code, build, test, and deploy mobile apps that run on a wide variety of mobile platforms; Quickly refactor and extend existing back-end services and data to new mobile UIs Code analysis that warns you about poorly written code What’s new: •Support for CICS TS 5.1 & optimized COBOL v5 compiler •Enhanced JCL editing •Automate unit testing with zUnit •Headless code review and code coverage
  9. 9. 10 Modern application development across platforms Upgrade to modern Eclipse-based tools to develop and maintain enterprise applications spanning multiple platforms, languages and technologies  Rational Developer for System z  Rational Developer for zEnterprise Increase Productivity  Eclipse-based open source IDE  More attractive to recent university hires than legacy z/OS tooling  More relevant information is readily available  Speeds development with specialized editors and code generation wizards  Code assist, syntax highlighting, quick fixes, outline view  Accelerate application modernization  Enable CICS and IMS appls for Web Services / SOA  Lower skill requirements for new hires to code to complex architectures (e.g. Web 2.0)  Reduce Training Costs in adopting System z environment  Provides interactive access to z/OS for development, debug, job generation, job submission, monitoring and command execution  Free up mainframe for production workload  Workstation syntax checking reduces host workload  Unit Test feature offloads additional workload 10
  10. 10. 11 IDE Efficiency Benchmarks  An IBM productivity study concluded that RDz significantly improves productivity as compared to ISPF • 100 common (daily) ISPF tasks used during maintenance and support assignments – ISPF workflow translated (click-for-click) to RDz development – Project participants believed they were trying to find gaps between RDz and ISPF functionality • Mix of experienced (veteran) ISPF programmers and new-hire developers • Assumption was that only new-hire developers would be more productive – This turned out to be false % less time to complete System z application development tasks using RDz vs. ISPF Inexperienced ISPF Users Experienced ISPF Users Similar results achieved by Financial Services customers
  11. 11. 12 12 RD z – More than just a pretty editor, Its an Integrated Development Environment • Rich Functionality – Sophisticated application analysis and quality governance – Extensive programming assists and wizards – Seamless access to ISPF and eclipse-style editors – Operational navigation between the integrated components • Extensive functional integration – Application Lifecycle Management solution - ISDz – Problem Determination tools – Mainframe security facilities – Source Control Management products – Any 3rd Party/OEM tools on the Eclipse platform • World-wide partners and extensive Eco-system
  12. 12. 13
  13. 13. 14
  14. 14. Viewing down into the pit Program Control Flow Diagram: • Birds Eye view of source • Treat it like a blueprint • Navigable and linked to source • Export and save for documentation 15
  15. 15. Digging sideways – Performance Hierarchy 16 Conditional Statements Perform Until Statements Potential program fall thru
  16. 16. Finding nuggets of information 17
  17. 17. Navigation with Outline View 18 Sort alphabetically Hide Divisions Click on a paragraph to navigate to it in source view
  18. 18. Find Dialog • CTRL + F to bring up dialog • Can search case sensitive, forward, backward, on all code, or just that selected. • Regular expressions – Content assist available to help build a search query 19
  19. 19. Format source automagically 20 You are no longer limited to tedious ISPF functions for indenting code! Makes maintenance easier for all who follow you.
  20. 20. Identify Unreachable Code • Finds Dead Code – Source → Find Unreachable Code • Results mark lines or paragraphs that will never get called • Mark them out with Source→ Toggle Comments, then delete when confirmed 21
  21. 21. 22
  22. 22. 23
  23. 23. Editing Source Code • System z LPEX Editor – Can emulate ISPF line commands & functions – Generic editor for all source • Specific source editors to give a richer feel – COBOL, PL/I – C/C++ – JCL 24
  24. 24. Hovers • Hover mouse over a variable, or perform statement • Popup displays the declaration • Press F2 to make the window retain focus 25
  25. 25. Hover over a Copy Statement • Hold down CNTL key and hover over the copybook name • Copybook name becomes a hyperlink – click to open – Also opens a hover window showing the contents of the window 26 SYSLIB property group must be set for this to work
  26. 26. Content Assist • Shows list of valid variables, or language structures • Intelligence to suggest SQL within an EXEC statement 27
  27. 27. Quick Fix • Margin area shows warnings and errors • Quick fix suggestions show as a light bulb • Parser is able to suggest fixes when clicked • Click on the suggestion to make the change 28
  28. 28. • Enable against COBOL 4.2, or 5.1 (the latest version) • Make checks for EXEC statements 29 Real Time Syntax Checking
  29. 29. Refactoring 30 Refactoring: make system-wide code changes without affecting the behavior of the program. Refactoring commands are available from the context menus of several views (e.g. Project Explorer, Outline) and editors. Many "apparently simple" commands, such as Move and Rename, are actually refactoring operations, since moving and renaming elements often require changes in dependent files. • Extract a function, constant or local variable • Rename a method, variable or class • Hide a method signature Operations can be previewed for all of the changes resulting from a refactoring action before you choose to carry them out.
  30. 30. Extract Constant (C/C++) • Improve performance, and avoid duplicate strings 31
  31. 31. Renaming Variables • Easily rename a variable throughout your code – More accurate than find/replace – Make variables easier to understand 32
  32. 32. Source Actions 33 Use the Source menu to perform many actions to modify, remove or generate code automatically. • Toggle a line or block as a comment; on or off. • Format entire source files or fragments. • Correct Indentation • Implement getters & setters • Sort lines The Source menu can be accessed from many context views such as in the COBOL, and C/C++ editor.
  33. 33. Toggle Commenting on and off • Toggle single line to comment on/off • Toggle a block of lines to comment on/off 34
  34. 34. Sorting Lines (C/C++) • Make content easier to read by alphabetizing your fields 35
  35. 35. Surround With • Easily move source into a conditional statement – for loop – do/while – if/else – try/catch • Highlight the desired code, right click -> Surround With – also ATL+SHIFT+Z
  36. 36. 37
  37. 37. 38
  38. 38. Searching • Multiple different types of search in the product – Remote z/OS Search – Data Model Search – File system search (local) – language based search (C/C++, Java, COBOL, etc) • Called from the search bar • Search from the context menu • Or a keyboard shortcut CNTL + H
  39. 39. Remote z/OS Search • Remote z/OS Search uses the RDz daemon on the server to scan MVS assets • Can scan through specific filters • Can scan selected PDS’s and members • Can also scan offline & migrated datasets 40
  40. 40. Search Types • By Partitioned Dataset Name – search by name of the PDS only • By Sequential Dataset – Can search by name, or within the content • By Dataset member – Can search by name, or within the content – Within name or content, can also search using regular expressions 41
  41. 41. Search Contexts • Searches only within a single LPAR (does not cross multiple systems) • Search on existing filters • Search within selected contexts – Could be a filter, a dataset, a sequential dataset, or multiple selected datasets 42
  42. 42. Using Regular Expressions to Search • For example custRec|tranRec • This will search and find any line in the search context that has either custRec, or tranRec – The pipe symbol ‘|’ acts as an “or” statement • Another example intsw*s= • This will find all integer instantiations with in the search context – w* = any word char repeated more than once – s = any whitespace character – int and = are treated as normal characters 43
  43. 43. Sub-setting search results • Sort columns ascending or descending • Expand source members to see lines where text was found • Filter result list within the client 44
  44. 44. Search Results 45 Sortable Columns Source Member Lines in source where text was found Filter to sub set results Expand / Collapse results Save results to Favorites Stop Search Edit query parameters View Menu Remove matches from view
  45. 45. The My Favorites Folder • Shows saved search queries – Great for ready access to frequently searched phrases • Save the search from the view menu • Saved searches can be edited, and run again 46
  46. 46. 47
  47. 47. 48
  48. 48. What is Software /Analyzer Code Review? • Provides a means for you to enforce shop coding standards and best practices • Available for COBOL programs opened from: – Remote Systems Explorer – Local Workstation Projects – including a PDS downloaded to a local project – z/OS Projects/MVS Subprojects • Easy to use: – Context-menu accessible - Create custom rule sets configuration based on in-the-box COBOL rules – More requirements (from customers) are encouraged/gladly accepted
  49. 49. Features • Somewhat customizable: – In-the-box rules customizable through Preferences/Configurations for rules • Application Code Review – Expands on existing Java code review – Check for COBOL standards deviations in the editor – Run reports on standards compliance and trends – Improve application quality and compliance 50
  50. 50. COBOL & PL/I Rules • Industry standard best practices – Naming – Performance – Structure of programs 51
  51. 51. 52 Results • Depending on which kind of analysis you are doing, the results view may differ. Some results views, like the one provided by Java code review, support viewing results in more than one format (a table or a tree, for example). • If you right-click on a result, you can perform special tasks, such as viewing the source code where the problem occurred or "quick fixing" the problem with an automatic result.
  52. 52. 53
  53. 53. Resources • Check out all our links for our presentations, including this one • 54
  54. 54. 55 Questions?
  55. 55. Socialize with us on Facebook & LinkedIn Subscribe to us at Discover us at: Watch Us at Youtube Call us at: 386-232-8746