In the last two decades, Network science has become a strategic field of research thanks to both the increased availability of large datasets, and the strong development of high-performance computing technologies and methodologies. Despite the great amount of work in the field of Communities detection in networks, one important question that still to be addressed is the statistical validation of the results for weighted networks (graphs). This work presents a Machine Learning approach to test whether community structures detected by algorithms are statistically significant or a result of chance in weighted graphs. This is achieved by investigating the stability of a clustering against random perturbations of the structure of the graph. We identify a null model, defining a perturbation strategy and then we define a testing procedure based on using functional data analysis tools. Our overall approach has been tested on both simulated and a real networks.We also explore the robustness of compressed networks. Compressing a large network into a super node representation has been shown to speed up community detection algorithms. In this work we apply our robustness testing procedure for weighted graphs on compressed networks. We show that a super node network representation preserves the robustness property of a network.