DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

The Latest Testing, Deployment, and Maintenance Topics

article thumbnail
The Magic Testing Challenge: Part 2
My last article raised an interesting discussion whether you should see tests more as documentation or more as specification. I agree that they can contribute to both of them, but I still think tests are just - tests... There were also complaints about my statement that testing often becomes tedious work which nobody likes. Also here I agree, that techniques like TDD can help you to structure your code and make sure you code exactly what is needed by writing the tests, but the result of the process will still be a class which needs to be tested somehow. So I have set up another small challenge to show how the visual approach featured by MagicTest helps to make testing a breeze. As you know, traditional assertion-based test frameworks like TestNG or JUnit force us to include the expected results in the test code. Where this may be more or less suitable for simple tests (like in the previous article), it quickly becomes cumbersome if the test handles complex objects or voluminous data. The Task We must test the method createEvenOddTable() (see appended ) with the following functionality: Create HTML table (elements table, tr, td) with specified number of data rows and columns. An additional row will be added to store header information (element th). An additional column will be added which contains the row number (element th) The rows will have attribute class set to "head", "even", or "odd" for easy styling. Both the specification (the 4 lines above) and the source code itself (25 lines) are short and simple to understand, so any experienced developer will write this method in a few minutes. So what's the problem with testing this method? We will see if we look at how MagicTest handles this case. The Magic Test The MagicTest for this method looks like this: public class HtmlTableTest { @Trace public void testCreateEvenOddTable() { HtmlTable.createEvenOddTable(4, 3); } @Formatter(outputType=OutputType.TEXT) public static String formatElement(Element elem) { XMLOutputter serializer = new XMLOutputter(); serializer.setFormat(Format.getPrettyFormat()); return serializer.outputString(elem); } } Some details: We use the @Trace annotation to automatically capture information about calls to the method under test. We rely on naming conventions, so the method HtmlTable.createEvenOddTable() is tested by HtmlTableTest.testCreateEvenOddTable(). Per default, MagicTest uses the toString() method to report the parameter and return values. As the Element's toString() method returns only its name, we have to define a custom @Formatter to get the full XML tree. If we run the test, we get the following report: If we look at the XML element tree in the report, we can see all the details which a complete test should cover: correct nesting of elements (table, tr, td), correct header line, correct line numbers, correct number of rows, correct number of cells for each row, correct class attribute for each row, etc. But even if you end up with a bunch of lengthy assert statements like assert("head".equals(((Element) elem.getChildren("tr").get(0)).getAttributeValue("class"))); which tests for the correct class attribute, this will not be enough: you should also test the absence of the class attribute for all cells except the first ones in each row. So yes, for a sound test you must actually verify the whole XML tree - and this is exactly the information which MagicTest shows you for confirmation. Let the Challenge Begin To run the test yourself, you will need to download the MagicTest Eclipse plug-in. Copy it into the Eclipse dropins folder and restart Eclipse. Then download the attached Eclipse project and import it into your workspace. Run the test class TagsTest by executing Run As / MagicTest. After the first run, the test report will show up and all test steps will be red. This is the MagicTest way of telling you that a step has failed. In our case, the steps just fail because MagicTest simply does not know anything about the expected result. So we carefully check the output and confirm its correctness by clicking on the save button. Now all steps are green - and the test is successful. You have now seen how efficiently this test can be realized using MagicTest - it even looked like fun. Does your test tool accept the challenge? How many minutes and lines does it take you to write the test? I'm looking forward to your contributions! Appendix: Listing HtmlTable /** * Create HTML table (elements table, tr, td) with specified number of data rows and columns. * An additional row will be added to store header information (element th). * An additional column will be added which contains the row number (element th) * The rows will have attribute class set to "head", "even", or "odd" for easy styling. * * @param rows number of rows * @param cols number of column * @return XML element containing the HTML table */ public static Element createEvenOddTable(int rows, int cols) { Element table = new Element("table"); for (int r=0; r 0) { td.setText(Integer.toString(r)); } } } return table; }
May 23, 2023
by Thomas Mauch
· 5,267 Views · 1 Like
article thumbnail
Keeping in Touch With EclipseCon 2009
There's only one weekend left until we get to EclipseCon 2009 - and I can't wait! You'll have already seen what talks I'm looking forward to. We'll have lots of coverage of the conference here at EclipseZone. Another really easy way to follow the conference is by using Twitter to follow EclipseCon people. All you need to do to find these people is head over to the EclipseCon Birds Nest. There's four different ways to partipate - as a standard follower, as a speaker, an exhibitor or an attendee. There's going to be a Twitter monitor in the lounge area for people to watch what people are saying about the conference. Twittervision - how cool is that?! Ian Skerrett is also planning a tweetup on Sunday night. Over the last few weeks I've become a Twitter addict myself - it's a great way to keep in touch with the latest goings on. (If you want to follow me, just go to my profile as dzonejames.) In other EclipseCon news, Sun Microsystems have become a Gold Sponsor for the conference. They will be showing their Eclipse support for JavaFX, GlassFish and Solaris. It's good to see Sun there. If you haven't registered yet, there's still time for advance registration, ending today. Make sure to use your DZone coupon to get 10% off, using the DZONE10 code. Otherwise you can register on site. So, if you want to stay in the loop for EclipseCon, become part of the Birds Nest , follow me around on Twitter and keep visiting EclipseZone.
May 23, 2023
by James Sugrue
· 6,406 Views · 1 Like
article thumbnail
iOS First, Android Later (or Never)
You don't generally hear that you should develop for Android first, but even if you go iOS first, Android comes second. That's the traditional wisdom, anyways. According to Semil Shah on Haywire, though, "iOS first" is an understatement. It should be iOS first, and Android in the distant future, if at all. Shah is fairly direct with his point of view: The most common trap here is the early iOS app which gets some buzz. All of a sudden, the founders hear “When are you building for Android?” The natural, enthusiastic response to sincere requests of the Android chorus is to go ahead and build for Android and seek more downloads, more growth, more revenue. I have a different view though. The proper response is: “No. Buy an iPhone.” Shah's reasoning is presented in three central arguments: Android's fragmentation problem is too much for small teams iOS users have all the money (and their numbers are growing) Future Apple hardware (iPhone 5c, for example) may level the playing field And these are some interesting thoughts. The third point in particular is one you don't hear often - one of the big selling points of Android as a development platform is the massive reach, which is a product of the sheer number of phones in consumers' hands. After all, iOS traditionally has a higher barrier of entry when it comes to economics. On the other hand, we've already seen some counterarguments to some of these points. For example, if you ask Nick Bradbury, fragmentation is a completely overblown problem, and according to Danny Roa, there's not really that much point to supporting older devices in the first place. Similarly, Kevin Quach suggests that the common notions surrounding Android's monetization opportunities - that they're not there, basically, at least compared to iOS - are bunk as well. In other words, the "iOS first" vs. "Android first" argument may not be so clear in either direction. Check out Shah's full article for all the details.
May 23, 2023
by Alec Noller
· 7,969 Views · 1 Like
article thumbnail
What Makes CI/CD for Salesforce Different?
CI/CD for Salesforce is absolutely achievable, but it takes a different approach due to unique technical challenges and different expectations of the platform.
May 22, 2023
by David Runciman
· 2,158 Views · 1 Like
article thumbnail
How To Improve Performance Using AWS and Terraform
In this article, we will discuss the advantages of using AWS and Terraform and provide an example of this collaboration for better understanding.
May 22, 2023
by Vladislav Bilay
· 8,618 Views · 3 Likes
article thumbnail
What Is Istio Ambient Mesh?
Istio has released a sidecar-less data plane called ambient mode. Explore its architecture and the benefits it can bring to enterprises.
May 22, 2023
by Debasree Panda
· 2,268 Views · 4 Likes
article thumbnail
Developers Are Scaling Faster Than Ever: Here’s How Security Can Keep Up
We know traditional security practices can’t support this scale, so how do modern practices allow us to scale security with these architectures?
May 22, 2023
by Aakash Shah
· 3,074 Views · 1 Like
article thumbnail
Testing, Monitoring, and Data Observability: What’s the Difference?
This article will give you a better understanding of data quality testing, monitoring, and observability. So let's explore these concepts together.
May 22, 2023
by Lior Gavish
· 2,831 Views · 1 Like
article thumbnail
What Is Test Pyramid: Getting Started With Test Automation Pyramid
A comprehensive Test Pyramid tutorial that covers what Test Pyramid is, its importance, benefits, best practices, and more.
May 22, 2023
by Praveen Mishra
· 6,743 Views · 9 Likes
article thumbnail
DevOps Pipeline and Its Essential Tools
DevOps pipelines automate software development workflow for continuous integration, delivery, and deployment.
May 22, 2023
by Sridhar Mannava
· 3,421 Views · 2 Likes
article thumbnail
An Overview of Kubernetes Security Projects at KubeCon Europe 2023
Kubernetes security is more important than ever and should be top-of-mind for most teams. Walk through the latest in k8s security solutions from KubeCon 2023.
May 22, 2023
by John Vester DZone Core CORE
· 48,845 Views · 4 Likes
article thumbnail
HTML5 on Android 4.0: Way Better, Still Behind iOS 5
So affirms Sencha, in the latest installment of their HTML5 developer scorecards series. Four-sentence version: After putting the Galaxy Nexus through our test wringer, we can say that Ice Cream Sandwich is a major step for the Android browser. However, it still falls short of iOS 5. It’s a solid browser for normal page browsing and it adds major new features that support most of the HTML5 spec. It also has taken a big step forward in correctness of rendering, which is a welcome change for people who want to push their mobile browsers to the limit. The most exciting new feature support, in Sencha's opinion: tons of CSS3, including the more nativey-slick, like animations, refletions, transformations, and transitions. Some specific missing features: Web Workers Web Sockets WebGL datetime and range input types overflow-scrolling Shared Workers The device Sencha used was a Samsung Galaxy Nexus, which meant that some performance and zoom issues might tell you as much about the hardware as about the OS. But the biggest rendering improvement: rendering was simply correct. One way Ice Cream Sandwich beat iOS 5? Embedded inline HTML5 video. They actually played inline on the Galaxy Nexus, in Sencha's tests; they didn't on the iPad and iPhone running iOS 5. Here's Sencha's rather glowing closing summary: In summary, the Galaxy Nexus and Ice Cream Sandwich are a major step forward for the Android platform. Feature by feature, HTML5 support has gotten much better, rendering has become more accurate, and performance has gotten much faster. Although still behind the current HTML5 gold standard of iOS5, Android 4.0 is night and day compared to previous versions. That 'night and day' is pretty strong, and definitely great news for HTML5 developers. If you're developing HTML5 apps for mobile, you should probably read the full report, which includes JavaScript performance numbers via SunSpider, Acid3 scores, and detailed results of Sencha's own touch-specific test suite.
May 22, 2023
by John Esposito
· 17,513 Views · 1 Like
article thumbnail
How to Make Android Development Less Frustrating
Sometimes, Android development is terrible. This recent blog post by Tony Cosentini discusses some of the more common and recognizable pain points in Android development, and how to get around them. Consentini concedes that Android development has been improving lately, pointing to developments like Android Studio and its Gradle build system, but there are still problems. In particular, he focuses on the following: Activities that are treated like view controllers The fragility of intents Problematic unit testing And for each, he provides a solution. For example, he points to Square as a useful source for a number of Android-simplifying solutions. Take a look at the full post for more ideas on how to solve some of the basic frustrations in Android development.
May 22, 2023
by Alec Noller
· 11,086 Views · 1 Like
article thumbnail
How it Feels to Switch from Eclipse to Android Studio
So, Android Studio exists. While there are a number of fixes for the less-than-graceful aspects of Android development in Eclipse - Genymotion, right? - some are moving to Android Studio for a more stream-lined approach. This recent post from MeetMe's engineering blog details Bill Donahue's switch from Eclipse to Android Studio, and he has some pretty strong feelings about it. He says - and this is his own emphasis - the following: I will never go back to Eclipse Donahue then explains the key differences as he sees them. First he makes a list of complaints about Eclipse - constant refreshing, awkward UI building, hogging RAM, and so on - followed by a list of the improvements found in Android Studio, such as full-program themes, new UI tools, better stability and performance, and more. He does point to a couple of hiccups, such as the switch to a Gradle build, but it's more of a thing you're going to have to learn than an issue with Android Studio. Check out Donahue's full post for more details on the switch and the little things Android Studio does to make it more comfortable.
May 22, 2023
by Alec Noller
· 17,666 Views · 1 Like
article thumbnail
How to Handle Secrets in Kubernetes
One crucial aspect of ensuring a secure Kubernetes infrastructure is the effective management of secrets, such as API keys, passwords, and tokens.
May 21, 2023
by Keshav Malik
· 2,702 Views · 2 Likes
article thumbnail
IBM App Connect Enterprise Pipelines and Integration Nodes
Explore how flexibility in ACE allows the progression of independent unit testing, without needing to wait for a larger organization to move to containers.
May 21, 2023
by Trevor Dolby
· 2,168 Views · 2 Likes
article thumbnail
Foursquare Moves to the Future With a Geospatial Knowledge Graph
In this interview, learn more about what kind of data Foursquare deals with, what it does with that data, and how using a knowledge graph is going to help.
May 21, 2023
by George Anadiotis
· 2,390 Views · 1 Like
article thumbnail
Building A Log Analytics Solution 10 Times More Cost-Effective Than Elasticsearch
Inverted indexing in Apache Doris 2.0.0 realizes two times faster log query performance than Elasticsearch with 1/5 of the storage space it uses.
May 19, 2023
by Shirley H.
· 5,437 Views · 4 Likes
article thumbnail
How To Choose the Right DevOps Tool for Your Project
The factors you should consider when selecting a DevOps tool for your project and some of the most useful tools in various categories.
May 19, 2023
by Mariusz Michalowski
· 4,202 Views · 2 Likes
article thumbnail
Which Is Better for IoT: Azure RTOS or FreeRTOS?
IoT needs speed, reliability, and energy efficiency that isn’t guaranteed in a desktop environment. Let's look at how to choose the right real-time operating system.
May 19, 2023
by Carsten Rhod Gregersen
· 9,771 Views · 1 Like
  • Previous
  • ...
  • 199
  • 200
  • 201
  • 202
  • 203
  • 204
  • 205
  • 206
  • 207
  • 208
  • ...
  • Next
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook
×